home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / source / contrib / answers / answers.dtx < prev    next >
LaTeX Document  |  1995-03-10  |  13.7 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
99% dexvert Texinfo Document (document/texInfo) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX 2e document text default
99% file LaTeX document text default
98% file TeX document text default
97% file LaTeX document, ASCII text default
100% TrID LaTeX 2e document (with rem) default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 20 20 20 5c 69 66 | 66 61 6c 73 65 20 6d 65 |% \if|false me|
|00000010| 74 61 2d 63 6f 6d 6d 65 | 6e 74 0a 25 20 20 20 20 |ta-comme|nt.% |
|00000020| 5c 62 65 67 69 6e 7b 6d | 61 63 72 6f 63 6f 64 65 |\begin{m|acrocode|
|00000030| 7d 0a 25 3c 2a 61 6e 73 | 77 65 72 73 3e 0a 5c 64 |}.%<*ans|wers>.\d|
|00000040| 65 66 5c 66 69 6c 65 76 | 65 72 73 69 6f 6e 7b 32 |ef\filev|ersion{2|
|00000050| 2e 30 31 7d 0a 5c 64 65 | 66 5c 66 69 6c 65 64 61 |.01}.\de|f\fileda|
|00000060| 74 65 7b 31 39 39 34 2f | 30 33 2f 33 30 7d 0a 5c |te{1994/|03/30}.\|
|00000070| 64 65 66 5c 66 69 6c 65 | 6e 61 6d 65 7b 61 6e 73 |def\file|name{ans|
|00000080| 77 65 72 73 2e 64 74 78 | 7d 0a 5c 64 65 66 5c 43 |wers.dtx|}.\def\C|
|00000090| 6f 70 79 72 69 67 68 74 | 7b 43 6f 70 79 72 69 67 |opyright|{Copyrig|
|000000a0| 68 74 20 28 43 29 20 31 | 39 39 30 2c 31 39 39 34 |ht (C) 1|990,1994|
|000000b0| 20 4d 69 6b 65 20 50 69 | 66 66 2c 20 55 6e 69 76 | Mike Pi|ff, Univ|
|000000c0| 65 72 73 69 74 79 20 6f | 66 20 53 68 65 66 66 69 |ersity o|f Sheffi|
|000000d0| 65 6c 64 2c 20 45 6e 67 | 6c 61 6e 64 7d 0a 25 3c |eld, Eng|land}.%<|
|000000e0| 2f 61 6e 73 77 65 72 73 | 3e 0a 25 20 20 20 20 5c |/answers|>.% \|
|000000f0| 65 6e 64 7b 6d 61 63 72 | 6f 63 6f 64 65 7d 0a 25 |end{macr|ocode}.%|
|00000100| 0a 25 59 6f 75 20 61 72 | 65 20 6e 6f 74 20 61 6c |.%You ar|e not al|
|00000110| 6c 6f 77 65 64 20 74 6f | 20 63 68 61 6e 67 65 20 |lowed to| change |
|00000120| 74 68 69 73 20 66 69 6c | 65 2e 0a 25 0a 25 59 6f |this fil|e..%.%Yo|
|00000130| 75 20 61 72 65 20 4e 4f | 54 20 41 4c 4c 4f 57 45 |u are NO|T ALLOWE|
|00000140| 44 20 74 6f 20 64 69 73 | 74 72 69 62 75 74 65 20 |D to dis|tribute |
|00000150| 74 68 69 73 20 66 69 6c | 65 20 61 6c 6f 6e 65 2e |this fil|e alone.|
|00000160| 20 20 59 6f 75 20 61 72 | 65 20 4e 4f 54 0a 25 41 | You ar|e NOT.%A|
|00000170| 4c 4c 4f 57 45 44 20 74 | 6f 20 74 61 6b 65 20 6d |LLOWED t|o take m|
|00000180| 6f 6e 65 79 20 66 6f 72 | 20 74 68 65 20 64 69 73 |oney for| the dis|
|00000190| 74 72 69 62 75 74 69 6f | 6e 20 6f 72 20 75 73 65 |tributio|n or use|
|000001a0| 20 6f 66 20 74 68 69 73 | 0a 25 66 69 6c 65 20 65 | of this|.%file e|
|000001b0| 78 63 65 70 74 20 66 6f | 72 20 61 20 6e 6f 6d 69 |xcept fo|r a nomi|
|000001c0| 6e 61 6c 20 63 68 61 72 | 67 65 20 66 6f 72 20 63 |nal char|ge for c|
|000001d0| 6f 70 79 69 6e 67 20 65 | 74 63 2e 0a 25 0a 25 50 |opying e|tc..%.%P|
|000001e0| 6c 65 61 73 65 20 61 64 | 64 72 65 73 73 20 61 6e |lease ad|dress an|
|000001f0| 79 20 70 72 6f 62 6c 65 | 6d 73 20 74 6f 3a 0a 25 |y proble|ms to:.%|
|00000200| 0a 25 4d 2e 50 69 66 66 | 40 73 68 65 66 2e 61 63 |.%M.Piff|@shef.ac|
|00000210| 2e 75 6b 0a 25 0a 25 46 | 6f 72 20 75 70 64 61 74 |.uk.%.%F|or updat|
|00000220| 65 73 2c 20 63 6f 6e 74 | 61 63 74 20 79 6f 75 72 |es, cont|act your|
|00000230| 20 6e 65 61 72 65 73 74 | 20 43 54 41 4e 20 73 69 | nearest| CTAN si|
|00000240| 74 65 2e 0a 25 0a 25 20 | 20 20 20 5c 66 69 0a 25 |te..%.% | \fi.%|
|00000250| 0a 25 20 20 20 20 5c 43 | 68 65 63 6b 53 75 6d 7b |.% \C|heckSum{|
|00000260| 31 37 33 7d 0a 25 0a 25 | 20 5c 63 68 61 6e 67 65 |173}.%.%| \change|
|00000270| 73 7b 32 2e 30 7d 7b 31 | 39 39 34 2f 30 33 2f 32 |s{2.0}{1|994/03/2|
|00000280| 35 7d 7b 46 69 72 73 74 | 20 76 65 72 73 69 6f 6e |5}{First| version|
|00000290| 20 66 6f 72 20 4c 61 54 | 65 58 32 65 7d 0a 25 20 | for LaT|eX2e}.% |
|000002a0| 5c 63 68 61 6e 67 65 73 | 7b 32 2e 30 7d 7b 31 39 |\changes|{2.0}{19|
|000002b0| 39 34 2f 30 33 2f 33 30 | 7d 7b 57 68 6f 6f 70 73 |94/03/30|}{Whoops|
|000002c0| 21 20 7c 5c 50 72 6f 76 | 69 64 65 73 50 61 63 6b |! |\Prov|idesPack|
|000002d0| 61 67 65 7b 61 6e 73 77 | 65 72 73 7d 7c 2c 0a 25 |age{answ|ers}|,.%|
|000002e0| 20 20 20 20 20 20 20 20 | 20 20 20 6e 6f 74 20 7c | | not ||
|000002f0| 5c 50 72 6f 76 69 64 65 | 73 43 6c 61 73 73 7b 41 |\Provide|sClass{A|
|00000300| 6e 73 77 65 72 73 7d 7c | 21 21 7d 0a 25 0a 25 0a |nswers}||!!}.%.%.|
|00000310| 25 20 20 20 20 5c 74 69 | 74 6c 65 7b 50 72 6f 64 |% \ti|tle{Prod|
|00000320| 75 63 74 69 6f 6e 20 6f | 66 20 73 6f 6c 75 74 69 |uction o|f soluti|
|00000330| 6f 6e 20 73 68 65 65 74 | 73 20 69 6e 20 5c 4c 61 |on sheet|s in \La|
|00000340| 54 65 58 65 7d 0a 25 20 | 20 20 20 5c 61 75 74 68 |TeXe}.% | \auth|
|00000350| 6f 72 7b 43 6f 70 79 72 | 69 67 68 74 20 28 43 29 |or{Copyr|ight (C)|
|00000360| 20 31 39 39 34 20 62 79 | 20 4d 69 6b 65 20 50 69 | 1994 by| Mike Pi|
|00000370| 66 66 7d 0a 25 0a 25 20 | 20 20 20 5c 6d 61 6b 65 |ff}.%.% | \make|
|00000380| 74 69 74 6c 65 0a 25 20 | 20 20 20 5c 74 61 62 6c |title.% | \tabl|
|00000390| 65 6f 66 63 6f 6e 74 65 | 6e 74 73 0a 25 0a 25 20 |eofconte|nts.%.% |
|000003a0| 20 20 20 5c 73 65 63 74 | 69 6f 6e 7b 49 6e 74 72 | \sect|ion{Intr|
|000003b0| 6f 64 75 63 74 69 6f 6e | 7d 0a 25 0a 25 20 20 20 |oduction|}.%.% |
|000003c0| 20 54 68 69 73 20 70 61 | 63 6b 61 67 65 20 69 73 | This pa|ckage is|
|000003d0| 20 61 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 20 | a modif|ication |
|000003e0| 6f 66 20 74 68 65 20 61 | 75 74 68 6f 72 27 73 20 |of the a|uthor's |
|000003f0| 70 72 65 76 69 6f 75 73 | 20 73 74 79 6c 65 20 6f |previous| style o|
|00000400| 70 74 69 6f 6e 0a 25 20 | 20 20 20 7c 61 6e 73 77 |ption.% | |answ|
|00000410| 65 72 73 7c 2c 20 77 68 | 69 63 68 20 68 61 73 20 |ers|, wh|ich has |
|00000420| 62 65 65 6e 20 69 6e 20 | 75 73 65 20 66 6f 72 20 |been in |use for |
|00000430| 61 20 66 65 77 20 79 65 | 61 72 73 2c 20 61 6e 64 |a few ye|ars, and|
|00000440| 20 77 61 73 20 62 61 73 | 65 64 20 75 70 6f 6e 20 | was bas|ed upon |
|00000450| 74 68 65 0a 25 20 20 20 | 20 5c 54 65 58 20 62 6f |the.% | \TeX bo|
|00000460| 6f 6b 20 69 64 65 61 20 | 6f 66 20 62 69 6e 64 69 |ok idea |of bindi|
|00000470| 6e 67 20 73 6f 6c 75 74 | 69 6f 6e 73 20 74 6f 20 |ng solut|ions to |
|00000480| 65 78 65 72 63 69 73 65 | 73 2e 20 49 20 68 61 76 |exercise|s. I hav|
|00000490| 65 20 74 61 6b 65 6e 20 | 74 68 65 0a 25 20 20 20 |e taken |the.% |
|000004a0| 20 6f 70 70 6f 72 74 75 | 6e 69 74 79 20 77 69 74 | opportu|nity wit|
|000004b0| 68 20 74 68 69 73 20 72 | 65 76 69 73 69 6f 6e 20 |h this r|evision |
|000004c0| 74 6f 20 61 6c 74 65 72 | 20 74 68 65 20 66 6f 72 |to alter| the for|
|000004d0| 6d 61 74 20 6f 66 20 74 | 68 65 20 73 6f 6c 75 74 |mat of t|he solut|
|000004e0| 69 6f 6e 73 2c 0a 25 20 | 20 20 20 73 6f 20 74 68 |ions,.% | so th|
|000004f0| 61 74 20 74 68 65 79 20 | 61 72 65 20 6e 6f 77 20 |at they |are now |
|00000500| 70 72 65 73 65 6e 74 65 | 64 20 61 73 20 5c 4c 61 |presente|d as \La|
|00000510| 54 65 58 5c 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |TeX\ env|ironment|
|00000520| 73 20 72 61 74 68 65 72 | 20 74 68 61 6e 0a 25 20 |s rather| than.% |
|00000530| 20 20 20 62 65 69 6e 67 | 20 73 74 61 72 74 65 64 | being| started|
|00000540| 20 77 69 74 68 20 61 20 | 63 6f 6d 6d 61 6e 64 20 | with a |command |
|00000550| 61 6e 64 20 65 6e 64 65 | 64 20 77 69 74 68 20 74 |and ende|d with t|
|00000560| 68 65 20 65 6e 64 20 6f | 66 20 74 68 65 20 73 75 |he end o|f the su|
|00000570| 72 72 6f 75 6e 64 69 6e | 67 0a 25 20 20 20 20 65 |rroundin|g.% e|
|00000580| 6e 76 69 72 6f 6e 6d 65 | 6e 74 2c 20 61 20 77 68 |nvironme|nt, a wh|
|00000590| 6f 6c 65 6c 79 20 75 6e | 2d 5c 4c 61 54 65 58 20 |olely un|-\LaTeX |
|000005a0| 79 20 77 61 79 20 6f 66 | 20 64 6f 69 6e 67 20 74 |y way of| doing t|
|000005b0| 68 69 6e 67 73 21 0a 25 | 0a 25 20 20 20 20 54 68 |hings!.%|.% Th|
|000005c0| 65 20 6f 74 68 65 72 20 | 6d 61 69 6e 20 63 68 61 |e other |main cha|
|000005d0| 6e 67 65 20 69 73 20 74 | 68 61 74 20 73 65 76 65 |nge is t|hat seve|
|000005e0| 72 61 6c 20 66 69 6c 65 | 73 20 61 72 65 20 61 6c |ral file|s are al|
|000005f0| 6c 6f 77 65 64 20 74 6f | 20 62 65 20 61 63 74 69 |lowed to| be acti|
|00000600| 76 65 0a 25 20 20 20 20 | 61 74 20 6f 6e 63 65 2e |ve.% |at once.|
|00000610| 20 54 68 69 73 20 61 6c | 6c 6f 77 73 20 73 6f 6d | This al|lows som|
|00000620| 65 20 73 6f 6c 75 74 69 | 6f 6e 73 20 69 6e 20 61 |e soluti|ons in a|
|00000630| 20 62 6f 6f 6b 20 28 66 | 6f 72 20 69 6e 73 74 61 | book (f|or insta|
|00000640| 6e 63 65 29 20 74 6f 20 | 67 6f 0a 25 20 20 20 20 |nce) to |go.% |
|00000650| 74 6f 20 74 68 65 20 61 | 70 70 65 6e 64 69 63 65 |to the a|ppendice|
|00000660| 73 2c 20 61 6e 64 20 73 | 6f 6d 65 20 74 6f 20 67 |s, and s|ome to g|
|00000670| 6f 20 74 6f 20 61 20 73 | 65 70 61 72 61 74 65 20 |o to a s|eparate |
|00000680| 66 69 6c 65 2c 20 74 6f | 20 62 65 20 70 72 69 6e |file, to| be prin|
|00000690| 74 65 64 20 61 6e 64 0a | 25 20 20 20 20 68 61 6e |ted and.|% han|
|000006a0| 64 65 64 20 74 6f 20 74 | 68 65 20 73 74 75 64 65 |ded to t|he stude|
|000006b0| 6e 74 73 20 61 73 20 74 | 68 65 20 63 6f 75 72 73 |nts as t|he cours|
|000006c0| 65 20 70 72 6f 67 72 65 | 73 73 65 73 2e 0a 25 0a |e progre|sses..%.|
|000006d0| 25 20 20 20 20 46 69 6e | 61 6c 6c 79 2c 20 61 6e |% Fin|ally, an|
|000006e0| 79 20 6e 75 6d 62 65 72 | 20 6f 66 20 73 6f 6c 75 |y number| of solu|
|000006f0| 74 69 6f 6e 2d 74 79 70 | 65 73 20 6d 61 79 20 6e |tion-typ|es may n|
|00000700| 6f 77 20 62 65 20 62 6f | 75 6e 64 20 74 6f 20 61 |ow be bo|und to a|
|00000710| 6e 79 20 66 69 6c 65 2c | 20 6e 6f 74 0a 25 20 20 |ny file,| not.% |
|00000720| 20 20 6a 75 73 74 20 74 | 68 65 20 74 77 6f 20 6f | just t|he two o|
|00000730| 6c 64 20 6f 6e 65 73 2c | 20 73 6f 6c 75 74 69 6f |ld ones,| solutio|
|00000740| 6e 20 61 6e 64 20 68 69 | 6e 74 2e 0a 25 0a 25 20 |n and hi|nt..%.% |
|00000750| 20 20 20 5c 73 65 63 74 | 69 6f 6e 7b 55 73 65 72 | \sect|ion{User|
|00000760| 20 69 6e 74 65 72 66 61 | 63 65 7d 0a 25 0a 25 20 | interfa|ce}.%.% |
|00000770| 20 20 20 54 68 65 20 70 | 61 63 6b 61 67 65 20 6e | The p|ackage n|
|00000780| 65 65 64 73 20 74 6f 20 | 62 65 20 69 6e 63 6c 75 |eeds to |be inclu|
|00000790| 64 65 64 20 77 69 74 68 | 20 74 68 65 20 63 6f 6d |ded with| the com|
|000007a0| 6d 61 6e 64 0a 25 20 20 | 20 20 5c 62 65 67 69 6e |mand.% | \begin|
|000007b0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 25 20 20 20 20 |{verbati|m}.% |
|000007c0| 20 20 20 20 20 20 20 20 | 20 5c 75 73 65 70 61 63 | | \usepac|
|000007d0| 6b 61 67 65 7b 61 6e 73 | 77 65 72 73 7d 0a 25 20 |kage{ans|wers}.% |
|000007e0| 20 20 20 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d | \end{|verbatim|
|000007f0| 7d 0a 25 0a 25 20 20 20 | 20 5c 44 65 73 63 72 69 |}.%.% | \Descri|
|00000800| 62 65 4d 61 63 72 6f 7b | 5c 4e 65 77 61 73 73 6f |beMacro{|\Newasso|
|00000810| 63 69 61 74 69 6f 6e 7d | 0a 25 20 20 20 20 41 66 |ciation}|.% Af|
|00000820| 74 65 72 20 74 68 61 74 | 2c 20 74 68 65 72 65 20 |ter that|, there |
|00000830| 73 68 6f 75 6c 64 20 62 | 65 20 73 65 76 65 72 61 |should b|e severa|
|00000840| 6c 20 64 65 63 6c 61 72 | 61 74 69 6f 6e 73 20 6f |l declar|ations o|
|00000850| 66 20 74 68 65 20 66 6f | 72 6d 0a 25 20 20 20 20 |f the fo|rm.% |
|00000860| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00000870| 0a 25 20 20 20 20 20 20 | 20 20 5c 4e 65 77 61 73 |.% | \Newas|
|00000880| 73 6f 63 69 61 74 69 6f | 6e 7b 78 78 78 7d 7b 79 |sociatio|n{xxx}{y|
|00000890| 79 79 7d 7b 7a 7a 7a 7d | 0a 25 20 20 20 20 5c 65 |yy}{zzz}|.% \e|
|000008a0| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 25 20 20 |nd{verba|tim}.% |
|000008b0| 20 20 77 68 65 72 65 20 | 7c 78 78 78 7c 20 69 73 | where ||xxx| is|
|000008c0| 20 61 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 | an envi|ronment |
|000008d0| 69 6e 20 74 68 65 20 64 | 6f 63 75 6d 65 6e 74 2c |in the d|ocument,|
|000008e0| 20 61 6e 64 20 7c 79 79 | 79 7c 20 69 73 20 61 6e | and |yy|y| is an|
|000008f0| 0a 25 20 20 20 20 65 6e | 76 69 72 6f 6e 6d 65 6e |.% en|vironmen|
|00000900| 74 20 77 68 69 63 68 20 | 77 69 6c 6c 20 73 75 72 |t which |will sur|
|00000910| 72 6f 75 6e 64 20 74 68 | 65 20 63 6f 6e 74 65 6e |round th|e conten|
|00000920| 74 73 20 6f 66 20 7c 78 | 78 78 7c 20 77 68 65 6e |ts of |x|xx| when|
|00000930| 20 69 74 20 69 73 0a 25 | 20 20 20 20 77 72 69 74 | it is.%| writ|
|00000940| 74 65 6e 20 74 6f 20 66 | 69 6c 65 20 7c 7a 7a 7a |ten to f|ile |zzz|
|00000950| 2e 73 6f 6c 7c 0a 25 0a | 25 20 20 20 20 5c 44 65 |.sol|.%.|% \De|
|00000960| 73 63 72 69 62 65 4d 61 | 63 72 6f 7b 5c 73 6f 6c |scribeMa|cro{\sol|
|00000970| 75 74 69 6f 6e 65 78 74 | 65 6e 73 69 6f 6e 7d 0a |utionext|ension}.|
|00000980| 25 20 20 20 20 54 68 65 | 20 63 6f 6d 6d 61 6e 64 |% The| command|
|00000990| 20 7c 5c 73 6f 6c 75 74 | 69 6f 6e 65 78 74 65 6e | |\solut|ionexten|
|000009a0| 73 69 6f 6e 7c 20 63 61 | 6e 20 62 65 20 72 65 64 |sion| ca|n be red|
|000009b0| 65 66 69 6e 65 64 20 74 | 6f 20 63 68 61 6e 67 65 |efined t|o change|
|000009c0| 20 7c 73 6f 6c 7c 20 74 | 6f 0a 25 20 20 20 20 73 | |sol| t|o.% s|
|000009d0| 6f 6d 65 20 6f 74 68 65 | 72 20 65 78 74 65 6e 73 |ome othe|r extens|
|000009e0| 69 6f 6e 2e 0a 25 0a 25 | 20 20 20 20 5c 44 65 73 |ion..%.%| \Des|
|000009f0| 63 72 69 62 65 4d 61 63 | 72 6f 7b 5c 4f 70 65 6e |cribeMac|ro{\Open|
|00000a00| 73 6f 6c 75 74 69 6f 6e | 66 69 6c 65 7d 0a 25 20 |solution|file}.% |
|00000a10| 20 20 20 5c 44 65 73 63 | 72 69 62 65 4d 61 63 72 | \Desc|ribeMacr|
|00000a20| 6f 7b 5c 43 6c 6f 73 65 | 73 6f 6c 75 74 69 6f 6e |o{\Close|solution|
|00000a30| 66 69 6c 65 7d 0a 25 20 | 20 20 20 41 74 20 73 6f |file}.% | At so|
|00000a40| 6d 65 20 70 6f 69 6e 74 | 20 74 68 65 20 75 73 65 |me point| the use|
|00000a50| 72 20 74 79 70 65 73 0a | 25 20 20 20 20 5c 62 65 |r types.|% \be|
|00000a60| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 25 20 |gin{verb|atim}.% |
|00000a70| 20 20 20 20 20 20 20 5c | 4f 70 65 6e 73 6f 6c 75 | \|Opensolu|
|00000a80| 74 69 6f 6e 66 69 6c 65 | 7b 7a 7a 7a 7d 0a 25 20 |tionfile|{zzz}.% |
|00000a90| 20 20 20 20 20 20 20 2e | 2e 2e 0a 25 20 20 20 20 | .|...% |
|00000aa0| 20 20 20 20 5c 43 6c 6f | 73 65 73 6f 6c 75 74 69 | \Clo|sesoluti|
|00000ab0| 6f 6e 66 69 6c 65 7b 7a | 7a 7a 7d 0a 25 20 20 20 |onfile{z|zz}.% |
|00000ac0| 20 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0a | \end{ve|rbatim}.|
|00000ad0| 25 20 20 20 20 74 6f 20 | 63 72 65 61 74 65 20 73 |% to |create s|
|00000ae0| 65 76 65 72 61 6c 20 66 | 69 6c 65 73 20 6f 66 20 |everal f|iles of |
|00000af0| 73 6f 6c 75 74 69 6f 6e | 73 20 77 72 69 74 74 65 |solution|s writte|
|00000b00| 6e 20 62 79 20 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 |n by env|ironment|
|00000b10| 73 20 7c 78 78 78 7c 20 | 74 6f 0a 25 20 20 20 20 |s |xxx| |to.% |
|00000b20| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 73 20 7c 79 79 |environm|ents |yy|
|00000b30| 79 7c 2e 0a 25 0a 25 20 | 20 20 20 5c 44 65 73 63 |y|..%.% | \Desc|
|00000b40| 72 69 62 65 4d 61 63 72 | 6f 7b 5c 57 72 69 74 65 |ribeMacr|o{\Write|
|00000b50| 74 6f 66 69 6c 65 7d 0a | 25 20 20 20 20 49 6e 20 |tofile}.|% In |
|00000b60| 61 64 64 69 74 69 6f 6e | 2c 20 6d 61 74 65 72 69 |addition|, materi|
|00000b70| 61 6c 20 63 61 6e 20 62 | 65 20 77 72 69 74 74 65 |al can b|e writte|
|00000b80| 6e 20 64 69 72 65 63 74 | 6c 79 20 74 6f 20 61 20 |n direct|ly to a |
|00000b90| 66 69 6c 65 20 62 79 20 | 6d 65 61 6e 73 20 6f 66 |file by |means of|
|00000ba0| 0a 25 20 20 20 20 7c 5c | 57 72 69 74 65 74 6f 66 |.% |\|Writetof|
|00000bb0| 69 6c 65 7c 2e 20 49 74 | 73 20 66 69 72 73 74 20 |ile|. It|s first |
|00000bc0| 61 72 67 75 6d 65 6e 74 | 20 69 73 20 74 68 65 20 |argument| is the |
|00000bd0| 66 69 6c 65 20 7c 7a 7a | 7a 7c 20 61 6e 64 20 69 |file |zz|z| and i|
|00000be0| 74 73 20 73 65 63 6f 6e | 64 20 69 73 0a 25 20 20 |ts secon|d is.% |
|00000bf0| 20 20 74 68 65 20 6c 69 | 6e 65 20 6f 66 20 74 65 | the li|ne of te|
|00000c00| 78 74 20 74 6f 20 62 65 | 20 77 72 69 74 74 65 6e |xt to be| written|
|00000c10| 2c 20 77 69 74 68 20 61 | 6e 79 20 63 6f 6e 74 72 |, with a|ny contr|
|00000c20| 6f 6c 20 77 6f 72 64 73 | 20 70 72 65 63 65 64 65 |ol words| precede|
|00000c30| 64 20 62 79 0a 25 20 20 | 20 20 7c 5c 70 72 6f 74 |d by.% | |\prot|
|00000c40| 65 63 74 7c 2e 0a 25 20 | 20 20 20 5c 44 65 73 63 |ect|..% | \Desc|
|00000c50| 72 69 62 65 45 6e 76 7b | 46 69 6c 65 73 61 76 65 |ribeEnv{|Filesave|
|00000c60| 7d 0a 25 20 20 20 20 41 | 6c 74 65 72 6e 61 74 69 |}.% A|lternati|
|00000c70| 76 65 6c 79 2c 20 61 20 | 62 6c 6f 63 6b 20 6f 66 |vely, a |block of|
|00000c80| 20 74 65 78 74 20 63 61 | 6e 20 62 65 20 73 61 76 | text ca|n be sav|
|00000c90| 65 64 20 74 6f 20 7c 7a | 7a 7a 7c 20 62 79 20 6d |ed to |z|zz| by m|
|00000ca0| 65 61 6e 73 20 6f 66 0a | 25 20 20 20 20 5c 62 65 |eans of.|% \be|
|00000cb0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 25 20 |gin{verb|atim}.% |
|00000cc0| 20 20 20 20 20 20 20 5c | 62 65 67 69 6e 7b 46 69 | \|begin{Fi|
|00000cd0| 6c 65 73 61 76 65 7d 7b | 7a 7a 7a 7d 0a 25 20 20 |lesave}{|zzz}.% |
|00000ce0| 20 20 20 20 20 20 20 20 | 20 2e 2e 2e 2e 0a 25 20 | | .....% |
|00000cf0| 20 20 20 20 20 20 20 5c | 65 6e 64 7b 46 69 6c 65 | \|end{File|
|00000d00| 73 61 76 65 7d 0a 25 20 | 20 20 20 5c 65 6e 64 7b |save}.% | \end{|
|00000d10| 76 65 72 62 61 74 69 6d | 7d 0a 25 20 20 20 20 61 |verbatim|}.% a|
|00000d20| 72 6f 75 6e 64 20 69 74 | 20 6f 6e 63 65 20 7c 7a |round it| once |z|
|00000d30| 7a 7a 7c 20 68 61 73 20 | 62 65 65 6e 20 6f 70 65 |zz| has |been ope|
|00000d40| 6e 65 64 2e 0a 25 0a 25 | 20 20 20 20 5c 44 65 73 |ned..%.%| \Des|
|00000d50| 63 72 69 62 65 4d 61 63 | 72 6f 7b 5c 52 65 61 64 |cribeMac|ro{\Read|
|00000d60| 73 6f 6c 75 74 69 6f 6e | 66 69 6c 65 7d 0a 25 20 |solution|file}.% |
|00000d70| 20 20 20 4f 6e 65 20 6f | 66 20 74 68 65 20 67 65 | One o|f the ge|
|00000d80| 6e 65 72 61 74 65 64 20 | 66 69 6c 65 73 20 63 61 |nerated |files ca|
|00000d90| 6e 20 62 65 20 72 65 61 | 64 20 75 73 69 6e 67 0a |n be rea|d using.|
|00000da0| 25 20 20 20 20 5c 62 65 | 67 69 6e 7b 76 65 72 62 |% \be|gin{verb|
|00000db0| 61 74 69 6d 7d 0a 25 20 | 20 20 20 20 20 20 20 5c |atim}.% | \|
|00000dc0| 52 65 61 64 73 6f 6c 75 | 74 69 6f 6e 66 69 6c 65 |Readsolu|tionfile|
|00000dd0| 7b 7a 7a 7a 7d 0a 25 20 | 20 20 20 5c 65 6e 64 7b |{zzz}.% | \end{|
|00000de0| 76 65 72 62 61 74 69 6d | 7d 0a 25 20 20 20 20 6f |verbatim|}.% o|
|00000df0| 72 20 73 69 6d 70 6c 79 | 20 7c 5c 69 6e 70 75 74 |r simply| |\input|
|00000e00| 7c 20 69 66 20 70 72 65 | 66 65 72 72 65 64 2e 0a || if pre|ferred..|
|00000e10| 25 0a 25 20 20 20 20 20 | 4e 6f 6e 65 20 6f 66 20 |%.% |None of |
|00000e20| 74 68 65 20 66 69 6c 65 | 20 6f 70 65 72 61 74 69 |the file| operati|
|00000e30| 6f 6e 73 20 73 68 6f 75 | 6c 64 20 68 61 76 65 20 |ons shou|ld have |
|00000e40| 61 6e 79 20 65 66 66 65 | 63 74 20 69 66 20 74 68 |any effe|ct if th|
|00000e50| 65 20 66 69 6c 65 20 7c | 7a 7a 7a 7c 0a 25 20 20 |e file ||zzz|.% |
|00000e60| 20 20 20 68 61 73 20 6e | 6f 74 20 62 65 65 6e 20 | has n|ot been |
|00000e70| 6f 70 65 6e 65 64 2e 0a | 25 0a 25 20 20 20 20 5c |opened..|%.% \|
|00000e80| 73 65 63 74 69 6f 6e 7b | 41 6e 20 65 78 61 6d 70 |section{|An examp|
|00000e90| 6c 65 7d 0a 25 0a 25 20 | 20 20 20 54 68 65 20 66 |le}.%.% | The f|
|00000ea0| 6f 6c 6c 6f 77 69 6e 67 | 20 69 73 20 61 6e 20 65 |ollowing| is an e|
|00000eb0| 78 61 6d 70 6c 65 20 6f | 66 20 74 68 65 20 75 73 |xample o|f the us|
|00000ec0| 65 20 6f 66 20 70 61 63 | 6b 61 67 65 20 7c 61 6e |e of pac|kage |an|
|00000ed0| 73 77 65 72 73 7c 2e 0a | 25 20 20 20 20 49 74 20 |swers|..|% It |
|00000ee0| 61 6c 73 6f 20 75 73 65 | 73 20 73 6f 6d 65 20 6f |also use|s some o|
|00000ef0| 66 20 74 68 65 20 72 65 | 66 69 6e 65 6d 65 6e 74 |f the re|finement|
|00000f00| 73 20 64 65 73 63 72 69 | 62 65 64 20 6c 61 74 65 |s descri|bed late|
|00000f10| 72 2e 0a 25 20 20 20 20 | 5c 62 65 67 69 6e 7b 6d |r..% |\begin{m|
|00000f20| 61 63 72 6f 63 6f 64 65 | 7d 0a 25 3c 2a 65 78 61 |acrocode|}.%<*exa|
|00000f30| 6d 70 6c 65 3e 0a 5c 64 | 6f 63 75 6d 65 6e 74 63 |mple>.\d|ocumentc|
|00000f40| 6c 61 73 73 5b 31 32 70 | 74 2c 61 34 70 61 70 65 |lass[12p|t,a4pape|
|00000f50| 72 5d 7b 61 72 74 69 63 | 6c 65 7d 0a 5c 75 73 65 |r]{artic|le}.\use|
|00000f60| 70 61 63 6b 61 67 65 7b | 61 6e 73 77 65 72 73 7d |package{|answers}|
|00000f70| 0a 0a 5c 6e 65 77 74 68 | 65 6f 72 65 6d 7b 45 78 |..\newth|eorem{Ex|
|00000f80| 7d 7b 45 78 65 72 63 69 | 73 65 7d 25 25 20 74 6f |}{Exerci|se}%% to|
|00000f90| 20 70 72 6f 64 75 63 65 | 20 74 68 65 20 72 65 66 | produce| the ref|
|00000fa0| 65 72 65 6e 63 65 20 6c | 61 62 65 6c 0a 0a 5c 4e |erence l|abel..\N|
|00000fb0| 65 77 61 73 73 6f 63 69 | 61 74 69 6f 6e 7b 73 6f |ewassoci|ation{so|
|00000fc0| 6c 75 74 69 6f 6e 7d 7b | 53 6f 6c 6e 7d 7b 74 65 |lution}{|Soln}{te|
|00000fd0| 73 74 7d 0a 5c 72 65 6e | 65 77 63 6f 6d 6d 61 6e |st}.\ren|ewcomman|
|00000fe0| 64 7b 5c 53 6f 6c 6e 6c | 61 62 65 6c 7d 5b 31 5d |d{\Solnl|abel}[1]|
|00000ff0| 7b 5c 65 6d 70 68 7b 53 | 6f 6c 75 74 69 6f 6e 20 |{\emph{S|olution |
|00001000| 23 31 7d 7d 0a 5c 4e 65 | 77 61 73 73 6f 63 69 61 |#1}}.\Ne|wassocia|
|00001010| 74 69 6f 6e 7b 68 69 6e | 74 7d 7b 48 69 6e 74 7d |tion{hin|t}{Hint}|
|00001020| 7b 74 65 73 74 7d 0a 5c | 72 65 6e 65 77 63 6f 6d |{test}.\|renewcom|
|00001030| 6d 61 6e 64 7b 5c 48 69 | 6e 74 6c 61 62 65 6c 7d |mand{\Hi|ntlabel}|
|00001040| 5b 31 5d 7b 5c 65 6d 70 | 68 7b 48 69 6e 74 20 23 |[1]{\emp|h{Hint #|
|00001050| 31 7d 7d 0a 5c 4e 65 77 | 61 73 73 6f 63 69 61 74 |1}}.\New|associat|
|00001060| 69 6f 6e 7b 53 6f 6c 75 | 74 69 6f 6e 7d 7b 73 53 |ion{Solu|tion}{sS|
|00001070| 6f 6c 7d 7b 74 65 73 74 | 74 77 6f 7d 0a 5c 72 65 |ol}{test|two}.\re|
|00001080| 6e 65 77 63 6f 6d 6d 61 | 6e 64 7b 5c 73 53 6f 6c |newcomma|nd{\sSol|
|00001090| 6c 61 62 65 6c 7d 5b 31 | 5d 7b 5c 65 6d 70 68 7b |label}[1|]{\emph{|
|000010a0| 53 6f 6c 75 74 69 6f 6e | 20 74 6f 20 23 31 7d 7d |Solution| to #1}}|
|000010b0| 0a 5c 72 65 6e 65 77 63 | 6f 6d 6d 61 6e 64 7b 5c |.\renewc|ommand{\|
|000010c0| 73 53 6f 6c 70 61 72 61 | 6d 73 7d 7b 7b 5c 43 75 |sSolpara|ms}{{\Cu|
|000010d0| 72 72 65 6e 74 6c 61 62 | 65 6c 28 70 2e 5c 74 68 |rrentlab|el(p.\th|
|000010e0| 65 70 61 67 65 29 7d 7d | 0a 0a 5c 62 65 67 69 6e |epage)}}|..\begin|
|000010f0| 7b 64 6f 63 75 6d 65 6e | 74 7d 0a 5c 4f 70 65 6e |{documen|t}.\Open|
|00001100| 73 6f 6c 75 74 69 6f 6e | 66 69 6c 65 7b 74 65 73 |solution|file{tes|
|00001110| 74 7d 0a 5c 57 72 69 74 | 65 74 6f 66 69 6c 65 7b |t}.\Writ|etofile{|
|00001120| 74 65 73 74 7d 7b 5c 70 | 72 6f 74 65 63 74 5c 73 |test}{\p|rotect\s|
|00001130| 65 63 74 69 6f 6e 7b 53 | 6f 6c 75 74 69 6f 6e 73 |ection{S|olutions|
|00001140| 7d 7d 0a 5c 4f 70 65 6e | 73 6f 6c 75 74 69 6f 6e |}}.\Open|solution|
|00001150| 66 69 6c 65 7b 74 65 73 | 74 74 77 6f 7d 0a 5c 57 |file{tes|ttwo}.\W|
|00001160| 72 69 74 65 74 6f 66 69 | 6c 65 7b 74 65 73 74 74 |ritetofi|le{testt|
|00001170| 77 6f 7d 7b 5c 70 72 6f | 74 65 63 74 5c 73 65 63 |wo}{\pro|tect\sec|
|00001180| 74 69 6f 6e 7b 45 78 74 | 72 61 20 53 6f 6c 75 74 |tion{Ext|ra Solut|
|00001190| 69 6f 6e 73 7d 7d 0a 5c | 73 65 63 74 69 6f 6e 7b |ions}}.\|section{|
|000011a0| 46 69 72 73 74 7d 0a 5c | 62 65 67 69 6e 7b 45 78 |First}.\|begin{Ex|
|000011b0| 7d 0a 20 20 20 41 6e 20 | 65 78 65 72 63 69 73 65 |}. An |exercise|
|000011c0| 20 77 69 74 68 20 61 20 | 73 6f 6c 75 74 69 6f 6e | with a |solution|
|000011d0| 2e 0a 20 20 20 5c 62 65 | 67 69 6e 7b 73 6f 6c 75 |.. \be|gin{solu|
|000011e0| 74 69 6f 6e 7d 0a 20 20 | 20 20 20 20 54 68 69 73 |tion}. | This|
|000011f0| 20 69 73 20 61 20 73 6f | 6c 75 74 69 6f 6e 2e 0a | is a so|lution..|
|00001200| 20 20 20 20 20 20 5c 72 | 65 6c 61 78 7b 7d 0a 20 | \r|elax{}. |
|00001210| 20 20 5c 65 6e 64 7b 73 | 6f 6c 75 74 69 6f 6e 7d | \end{s|olution}|
|00001220| 0a 5c 65 6e 64 7b 45 78 | 7d 0a 5c 62 65 67 69 6e |.\end{Ex|}.\begin|
|00001230| 7b 45 78 7d 0a 20 20 20 | 41 6e 20 65 78 65 72 63 |{Ex}. |An exerc|
|00001240| 69 73 65 20 77 69 74 68 | 20 61 20 68 69 6e 74 20 |ise with| a hint |
|00001250| 61 6e 64 20 61 20 73 65 | 63 72 65 74 20 73 6f 6c |and a se|cret sol|
|00001260| 75 74 69 6f 6e 2e 0a 20 | 20 20 5c 62 65 67 69 6e |ution.. | \begin|
|00001270| 7b 68 69 6e 74 7d 0a 20 | 20 20 20 20 20 54 68 69 |{hint}. | Thi|
|00001280| 73 20 69 73 20 61 20 68 | 69 6e 74 2e 0a 20 20 20 |s is a h|int.. |
|00001290| 5c 65 6e 64 7b 68 69 6e | 74 7d 0a 20 20 20 5c 62 |\end{hin|t}. \b|
|000012a0| 65 67 69 6e 7b 53 6f 6c | 75 74 69 6f 6e 7d 0a 20 |egin{Sol|ution}. |
|000012b0| 20 20 20 20 20 54 68 69 | 73 20 69 73 20 61 20 73 | Thi|s is a s|
|000012c0| 65 63 72 65 74 20 73 6f | 6c 75 74 69 6f 6e 2e 0a |ecret so|lution..|
|000012d0| 20 20 20 5c 65 6e 64 7b | 53 6f 6c 75 74 69 6f 6e | \end{|Solution|
|000012e0| 7d 0a 5c 65 6e 64 7b 45 | 78 7d 0a 5c 62 65 67 69 |}.\end{E|x}.\begi|
|000012f0| 6e 7b 45 78 7d 0a 20 20 | 20 41 6e 20 65 78 65 72 |n{Ex}. | An exer|
|00001300| 63 69 73 65 20 77 69 74 | 68 20 61 20 68 69 6e 74 |cise wit|h a hint|
|00001310| 2e 0a 20 20 20 5c 62 65 | 67 69 6e 7b 68 69 6e 74 |.. \be|gin{hint|
|00001320| 7d 0a 20 20 20 20 20 20 | 54 68 69 73 20 69 73 20 |}. |This is |
|00001330| 61 20 68 69 6e 74 2e 0a | 20 20 20 5c 65 6e 64 7b |a hint..| \end{|
|00001340| 68 69 6e 74 7d 0a 5c 65 | 6e 64 7b 45 78 7d 0a 5c |hint}.\e|nd{Ex}.\|
|00001350| 43 6c 6f 73 65 73 6f 6c | 75 74 69 6f 6e 66 69 6c |Closesol|utionfil|
|00001360| 65 7b 74 65 73 74 7d 0a | 5c 52 65 61 64 73 6f 6c |e{test}.|\Readsol|
|00001370| 75 74 69 6f 6e 66 69 6c | 65 7b 74 65 73 74 7d 0a |utionfil|e{test}.|
|00001380| 5c 63 6c 65 61 72 70 61 | 67 65 0a 5c 43 6c 6f 73 |\clearpa|ge.\Clos|
|00001390| 65 73 6f 6c 75 74 69 6f | 6e 66 69 6c 65 7b 74 65 |esolutio|nfile{te|
|000013a0| 73 74 74 77 6f 7d 0a 5c | 52 65 61 64 73 6f 6c 75 |sttwo}.\|Readsolu|
|000013b0| 74 69 6f 6e 66 69 6c 65 | 7b 74 65 73 74 74 77 6f |tionfile|{testtwo|
|000013c0| 7d 0a 0a 5c 65 6e 64 7b | 64 6f 63 75 6d 65 6e 74 |}..\end{|document|
|000013d0| 7d 0a 25 3c 2f 65 78 61 | 6d 70 6c 65 3e 0a 25 20 |}.%</exa|mple>.% |
|000013e0| 20 20 20 5c 65 6e 64 7b | 6d 61 63 72 6f 63 6f 64 | \end{|macrocod|
|000013f0| 65 7d 0a 25 0a 25 0a 25 | 20 20 20 20 5c 53 74 6f |e}.%.%.%| \Sto|
|00001400| 70 45 76 65 6e 74 75 61 | 6c 6c 79 7b 7d 0a 25 0a |pEventua|lly{}.%.|
|00001410| 25 0a 25 20 20 20 20 5c | 73 65 63 74 69 6f 6e 7b |%.% \|section{|
|00001420| 49 64 65 6e 74 69 66 69 | 63 61 74 69 6f 6e 7d 0a |Identifi|cation}.|
|00001430| 25 0a 25 20 20 20 20 54 | 68 69 73 20 70 61 63 6b |%.% T|his pack|
|00001440| 61 67 65 20 63 61 6e 20 | 6f 6e 6c 79 20 62 65 20 |age can |only be |
|00001450| 75 73 65 64 20 77 69 74 | 68 20 5c 4c 61 54 65 58 |used wit|h \LaTeX|
|00001460| 65 2c 20 73 6f 0a 25 20 | 20 20 20 61 6e 20 61 70 |e, so.% | an ap|
|00001470| 70 72 6f 70 72 69 61 74 | 65 20 6d 65 73 73 61 67 |propriat|e messag|
|00001480| 65 20 69 73 20 64 69 73 | 70 6c 61 79 65 64 20 77 |e is dis|played w|
|00001490| 68 65 6e 20 61 6e 6f 74 | 68 65 72 0a 25 20 20 20 |hen anot|her.% |
|000014a0| 20 66 6f 72 6d 61 74 20 | 69 73 20 75 73 65 64 2e | format |is used.|
|000014b0| 0a 25 20 20 20 20 5c 62 | 65 67 69 6e 7b 6d 61 63 |.% \b|egin{mac|
|000014c0| 72 6f 63 6f 64 65 7d 0a | 25 3c 2a 61 6e 73 77 65 |rocode}.|%<*answe|
|000014d0| 72 73 3e 0a 5c 4e 65 65 | 64 73 54 65 58 46 6f 72 |rs>.\Nee|dsTeXFor|
|000014e0| 6d 61 74 7b 4c 61 54 65 | 58 32 65 7d 5b 31 39 39 |mat{LaTe|X2e}[199|
|000014f0| 34 2f 30 31 2f 30 31 5d | 0a 25 20 20 20 20 5c 65 |4/01/01]|.% \e|
|00001500| 6e 64 7b 6d 61 63 72 6f | 63 6f 64 65 7d 0a 25 0a |nd{macro|code}.%.|
|00001510| 25 0a 25 20 20 20 20 41 | 6e 6e 6f 75 6e 63 65 20 |%.% A|nnounce |
|00001520| 74 68 65 20 70 61 63 6b | 61 67 65 20 6e 61 6d 65 |the pack|age name|
|00001530| 20 61 6e 64 20 69 74 73 | 20 76 65 72 73 69 6f 6e | and its| version|
|00001540| 3a 0a 25 20 20 20 20 5c | 62 65 67 69 6e 7b 6d 61 |:.% \|begin{ma|
|00001550| 63 72 6f 63 6f 64 65 7d | 0a 5c 50 72 6f 76 69 64 |crocode}|.\Provid|
|00001560| 65 73 50 61 63 6b 61 67 | 65 7b 61 6e 73 77 65 72 |esPackag|e{answer|
|00001570| 73 7d 5b 5c 66 69 6c 65 | 64 61 74 65 5d 0a 25 20 |s}[\file|date].% |
|00001580| 20 20 20 5c 65 6e 64 7b | 6d 61 63 72 6f 63 6f 64 | \end{|macrocod|
|00001590| 65 7d 0a 25 0a 25 20 20 | 20 20 20 41 6e 64 20 64 |e}.%.% | And d|
|000015a0| 69 73 70 6c 61 79 20 69 | 74 20 6f 6e 20 74 68 65 |isplay i|t on the|
|000015b0| 20 74 65 72 6d 69 6e 61 | 6c 20 28 61 6e 64 20 74 | termina|l (and t|
|000015c0| 68 65 20 6c 6f 67 20 66 | 69 6c 65 29 3a 0a 25 20 |he log f|ile):.% |
|000015d0| 20 20 20 5c 62 65 67 69 | 6e 7b 6d 61 63 72 6f 63 | \begi|n{macroc|
|000015e0| 6f 64 65 7d 0a 5c 74 79 | 70 65 6f 75 74 7b 50 61 |ode}.\ty|peout{Pa|
|000015f0| 63 6b 61 67 65 20 60 61 | 6e 73 77 65 72 73 27 20 |ckage `a|nswers' |
|00001600| 3c 5c 66 69 6c 65 64 61 | 74 65 3e 2e 7d 0a 5c 74 |<\fileda|te>.}.\t|
|00001610| 79 70 65 6f 75 74 7b 5c | 43 6f 70 79 72 69 67 68 |ypeout{\|Copyrigh|
|00001620| 74 7d 0a 25 20 20 20 20 | 5c 65 6e 64 7b 6d 61 63 |t}.% |\end{mac|
|00001630| 72 6f 63 6f 64 65 7d 0a | 25 0a 25 20 20 20 20 41 |rocode}.|%.% A|
|00001640| 73 20 74 68 69 73 20 70 | 61 63 6b 61 67 65 20 6e |s this p|ackage n|
|00001650| 6f 77 20 72 65 6c 69 65 | 73 20 68 65 61 76 69 6c |ow relie|s heavil|
|00001660| 79 20 6f 6e 20 74 68 65 | 20 7c 76 65 72 62 61 74 |y on the| |verbat|
|00001670| 69 6d 7c 20 70 61 63 6b | 61 67 65 2c 20 77 65 0a |im| pack|age, we.|
|00001680| 25 20 20 20 20 65 6e 73 | 75 72 65 20 74 68 61 74 |% ens|ure that|
|00001690| 20 74 68 61 74 20 69 73 | 20 6c 6f 61 64 65 64 2e | that is| loaded.|
|000016a0| 0a 25 20 20 20 20 5c 62 | 65 67 69 6e 7b 6d 61 63 |.% \b|egin{mac|
|000016b0| 72 6f 63 6f 64 65 7d 0a | 5c 52 65 71 75 69 72 65 |rocode}.|\Require|
|000016c0| 50 61 63 6b 61 67 65 7b | 76 65 72 62 61 74 69 6d |Package{|verbatim|
|000016d0| 7d 0a 25 20 20 20 20 5c | 65 6e 64 7b 6d 61 63 72 |}.% \|end{macr|
|000016e0| 6f 63 6f 64 65 7d 0a 25 | 0a 25 0a 25 20 20 20 20 |ocode}.%|.%.% |
|000016f0| 5c 73 65 63 74 69 6f 6e | 7b 46 69 6c 65 20 68 61 |\section|{File ha|
|00001700| 6e 64 6c 69 6e 67 7d 0a | 25 0a 25 20 20 20 20 5c |ndling}.|%.% \|
|00001710| 62 65 67 69 6e 7b 6d 61 | 63 72 6f 7d 7b 5c 73 6f |begin{ma|cro}{\so|
|00001720| 6c 75 74 69 6f 6e 65 78 | 74 65 6e 73 69 6f 6e 7d |lutionex|tension}|
|00001730| 0a 25 20 20 20 20 54 68 | 65 20 64 65 66 61 75 6c |.% Th|e defaul|
|00001740| 74 20 65 78 74 65 6e 73 | 69 6f 6e 20 66 6f 72 20 |t extens|ion for |
|00001750| 73 6f 6c 75 74 69 6f 6e | 20 66 69 6c 65 73 20 69 |solution| files i|
|00001760| 73 20 64 65 66 69 6e 65 | 64 20 68 65 72 65 2e 0a |s define|d here..|
|00001770| 25 20 20 20 20 5c 62 65 | 67 69 6e 7b 6d 61 63 72 |% \be|gin{macr|
|00001780| 6f 63 6f 64 65 7d 0a 5c | 6e 65 77 63 6f 6d 6d 61 |ocode}.\|newcomma|
|00001790| 6e 64 7b 5c 73 6f 6c 75 | 74 69 6f 6e 65 78 74 65 |nd{\solu|tionexte|
|000017a0| 6e 73 69 6f 6e 7d 7b 73 | 6f 6c 7d 0a 25 20 20 20 |nsion}{s|ol}.% |
|000017b0| 20 5c 65 6e 64 7b 6d 61 | 63 72 6f 63 6f 64 65 7d | \end{ma|crocode}|
|000017c0| 0a 25 20 20 20 20 49 74 | 20 6d 61 79 20 62 65 20 |.% It| may be |
|000017d0| 63 68 61 6e 67 65 64 20 | 77 69 74 68 20 7c 5c 72 |changed |with |\r|
|000017e0| 65 6e 65 77 63 6f 6d 6d | 61 6e 64 7c 2e 0a 25 20 |enewcomm|and|..% |
|000017f0| 20 20 20 5c 65 6e 64 7b | 6d 61 63 72 6f 7d 0a 25 | \end{|macro}.%|
|00001800| 0a 25 20 20 20 20 5c 62 | 65 67 69 6e 7b 65 6e 76 |.% \b|egin{env|
|00001810| 69 72 6f 6e 6d 65 6e 74 | 7d 7b 46 69 6c 65 73 61 |ironment|}{Filesa|
|00001820| 76 65 7d 0a 25 20 20 20 | 20 57 65 20 64 65 66 69 |ve}.% | We defi|
|00001830| 6e 65 20 61 6e 20 65 6e | 76 69 72 6f 6e 6d 65 6e |ne an en|vironmen|
|00001840| 74 20 7c 46 69 6c 65 73 | 61 76 65 7c 20 77 69 74 |t |Files|ave| wit|
|00001850| 68 20 6f 6e 65 20 70 61 | 72 61 6d 65 74 65 72 2c |h one pa|rameter,|
|00001860| 20 74 68 65 20 66 69 6c | 65 20 6e 61 6d 65 0a 25 | the fil|e name.%|
|00001870| 20 20 20 20 77 69 74 68 | 6f 75 74 20 65 78 74 65 | with|out exte|
|00001880| 6e 73 69 6f 6e 2e 20 49 | 74 20 69 73 20 73 69 6d |nsion. I|t is sim|
|00001890| 69 6c 61 72 20 74 6f 20 | 74 68 65 20 65 78 61 6d |ilar to |the exam|
|000018a0| 70 6c 65 20 6f 66 20 53 | 63 68 5c 22 6f 70 66 20 |ple of S|ch\"opf |
|000018b0| 69 6e 20 74 68 65 0a 25 | 20 20 20 20 64 65 73 63 |in the.%| desc|
|000018c0| 72 69 70 74 69 6f 6e 20 | 6f 66 20 7c 76 65 72 62 |ription |of |verb|
|000018d0| 61 74 69 6d 7c 2e 0a 25 | 20 20 20 20 5c 62 65 67 |atim|..%| \beg|
|000018e0| 69 6e 7b 6d 61 63 72 6f | 63 6f 64 65 7d 0a 5c 6e |in{macro|code}.\n|
|000018f0| 65 77 65 6e 76 69 72 6f | 6e 6d 65 6e 74 7b 46 69 |ewenviro|nment{Fi|
|00001900| 6c 65 73 61 76 65 7d 5b | 31 5d 7b 25 0a 20 20 20 |lesave}[|1]{%. |
|00001910| 5c 40 62 73 70 68 61 63 | 6b 0a 20 20 20 5c 64 65 |\@bsphac|k. \de|
|00001920| 66 5c 76 65 72 62 61 74 | 69 6d 40 70 72 6f 63 65 |f\verbat|im@proce|
|00001930| 73 73 6c 69 6e 65 7b 7d | 25 0a 20 20 20 5c 49 66 |ssline{}|%. \If|
|00001940| 66 69 6c 65 75 6e 64 65 | 66 69 6e 65 64 7b 23 31 |fileunde|fined{#1|
|00001950| 7d 7b 7d 7b 25 0a 20 20 | 20 20 20 20 5c 49 66 6f |}{}{%. | \Ifo|
|00001960| 70 65 6e 7b 23 31 7d 7b | 25 0a 20 20 20 20 20 20 |pen{#1}{|%. |
|00001970| 20 20 20 5c 64 65 66 5c | 76 65 72 62 61 74 69 6d | \def\|verbatim|
|00001980| 40 70 72 6f 63 65 73 73 | 6c 69 6e 65 7b 25 0a 20 |@process|line{%. |
|00001990| 20 20 20 20 20 20 20 20 | 20 20 20 5c 69 6d 6d 65 | | \imme|
|000019a0| 64 69 61 74 65 5c 77 72 | 69 74 65 5c 40 6e 61 6d |diate\wr|ite\@nam|
|000019b0| 65 75 73 65 7b 23 31 40 | 66 69 6c 65 7d 7b 5c 74 |euse{#1@|file}{\t|
|000019c0| 68 65 5c 76 65 72 62 61 | 74 69 6d 40 6c 69 6e 65 |he\verba|tim@line|
|000019d0| 7d 7d 25 0a 20 20 20 20 | 20 20 7d 7b 7d 25 0a 20 |}}%. | }{}%. |
|000019e0| 20 20 7d 25 0a 20 20 20 | 5c 6c 65 74 5c 64 6f 5c | }%. |\let\do\|
|000019f0| 40 6d 61 6b 65 6f 74 68 | 65 72 5c 64 6f 73 70 65 |@makeoth|er\dospe|
|00001a00| 63 69 61 6c 73 0a 20 20 | 20 5c 63 61 74 63 6f 64 |cials. | \catcod|
|00001a10| 65 60 5c 5e 5e 4d 5c 61 | 63 74 69 76 65 20 5c 63 |e`\^^M\a|ctive \c|
|00001a20| 61 74 63 6f 64 65 60 5c | 5e 5e 49 3d 31 32 5c 72 |atcode`\|^^I=12\r|
|00001a30| 65 6c 61 78 0a 20 20 20 | 5c 76 65 72 62 61 74 69 |elax. |\verbati|
|00001a40| 6d 40 73 74 61 72 74 0a | 7d 7b 5c 40 65 73 70 68 |m@start.|}{\@esph|
|00001a50| 61 63 6b 7d 0a 25 20 20 | 20 20 5c 65 6e 64 7b 6d |ack}.% | \end{m|
|00001a60| 61 63 72 6f 63 6f 64 65 | 7d 0a 25 20 20 20 20 5c |acrocode|}.% \|
|00001a70| 65 6e 64 7b 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 7d |end{envi|ronment}|
|00001a80| 0a 25 0a 25 20 20 20 20 | 5c 62 65 67 69 6e 7b 6d |.%.% |\begin{m|
|00001a90| 61 63 72 6f 7d 7b 5c 57 | 72 69 74 65 74 6f 66 69 |acro}{\W|ritetofi|
|00001aa0| 6c 65 7d 0a 25 20 20 20 | 20 49 74 20 69 73 20 61 |le}.% | It is a|
|00001ab0| 6c 73 6f 20 75 73 65 66 | 75 6c 20 74 6f 20 68 61 |lso usef|ul to ha|
|00001ac0| 76 65 20 61 20 63 6f 6d | 6d 61 6e 64 20 74 6f 20 |ve a com|mand to |
|00001ad0| 77 72 69 74 65 20 6d 61 | 74 65 72 69 61 6c 20 74 |write ma|terial t|
|00001ae0| 6f 20 74 68 65 20 66 69 | 6c 65 2e 0a 25 20 20 20 |o the fi|le..% |
|00001af0| 20 49 6e 20 74 68 69 73 | 2c 20 79 6f 75 20 6e 65 | In this|, you ne|
|00001b00| 65 64 20 74 6f 20 70 75 | 74 20 7c 5c 70 72 6f 74 |ed to pu|t |\prot|
|00001b10| 65 63 74 7c 20 62 65 66 | 6f 72 65 20 61 6e 79 20 |ect| bef|ore any |
|00001b20| 63 6f 6e 74 72 6f 6c 20 | 77 6f 72 64 73 20 69 6e |control |words in|
|00001b30| 20 74 68 65 0a 25 20 20 | 20 20 61 72 67 75 6d 65 | the.% | argume|
|00001b40| 6e 74 20 74 68 61 74 20 | 6d 69 67 68 74 20 65 78 |nt that |might ex|
|00001b50| 70 61 6e 64 20 70 72 65 | 6d 61 74 75 72 65 6c 79 |pand pre|maturely|
|00001b60| 20 61 6e 64 20 63 72 65 | 61 74 65 20 68 61 76 6f | and cre|ate havo|
|00001b70| 63 2e 0a 25 20 20 20 20 | 5c 62 65 67 69 6e 7b 6d |c..% |\begin{m|
|00001b80| 61 63 72 6f 63 6f 64 65 | 7d 0a 5c 6e 65 77 63 6f |acrocode|}.\newco|
|00001b90| 6d 6d 61 6e 64 7b 5c 57 | 72 69 74 65 74 6f 66 69 |mmand{\W|ritetofi|
|00001ba0| 6c 65 7d 5b 32 5d 7b 25 | 0a 20 20 20 5c 40 62 73 |le}[2]{%|. \@bs|
|00001bb0| 70 68 61 63 6b 0a 20 20 | 20 5c 49 66 66 69 6c 65 |phack. | \Iffile|
|00001bc0| 75 6e 64 65 66 69 6e 65 | 64 7b 23 31 7d 7b 7d 7b |undefine|d{#1}{}{|
|00001bd0| 25 0a 20 20 20 20 20 20 | 5c 49 66 6f 70 65 6e 7b |%. |\Ifopen{|
|00001be0| 23 31 7d 7b 25 0a 20 20 | 20 20 20 20 20 20 20 7b |#1}{%. | {|
|00001bf0| 25 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 6c |%. | \l|
|00001c00| 65 74 5c 70 72 6f 74 65 | 63 74 5c 73 74 72 69 6e |et\prote|ct\strin|
|00001c10| 67 0a 20 20 20 20 20 20 | 20 20 20 20 20 20 5c 69 |g. | \i|
|00001c20| 6d 6d 65 64 69 61 74 65 | 5c 77 72 69 74 65 5c 40 |mmediate|\write\@|
|00001c30| 6e 61 6d 65 75 73 65 7b | 23 31 40 66 69 6c 65 7d |nameuse{|#1@file}|
|00001c40| 7b 23 32 7d 25 0a 20 20 | 20 20 20 20 20 20 20 7d |{#2}%. | }|
|00001c50| 25 0a 20 20 20 20 20 20 | 7d 7b 7d 25 0a 20 20 20 |%. |}{}%. |
|00001c60| 7d 25 0a 20 20 20 5c 40 | 65 73 70 68 61 63 6b 0a |}%. \@|esphack.|
|00001c70| 7d 0a 25 20 20 20 20 5c | 65 6e 64 7b 6d 61 63 72 |}.% \|end{macr|
|00001c80| 6f 63 6f 64 65 7d 0a 25 | 20 20 20 20 5c 65 6e 64 |ocode}.%| \end|
|00001c90| 7b 6d 61 63 72 6f 7d 0a | 25 0a 25 20 20 20 20 5c |{macro}.|%.% \|
|00001ca0| 62 65 67 69 6e 7b 6d 61 | 63 72 6f 7d 7b 5c 49 66 |begin{ma|cro}{\If|
|00001cb0| 6f 70 65 6e 7d 0a 25 20 | 20 20 20 57 65 20 6e 65 |open}.% | We ne|
|00001cc0| 65 64 20 74 6f 20 63 68 | 65 63 6b 20 77 68 65 74 |ed to ch|eck whet|
|00001cd0| 68 65 72 20 6f 72 20 6e | 6f 74 20 61 20 66 69 6c |her or n|ot a fil|
|00001ce0| 65 20 69 73 20 61 6c 72 | 65 61 64 79 20 6f 70 65 |e is alr|eady ope|
|00001cf0| 6e 2e 0a 25 20 20 20 20 | 5c 62 65 67 69 6e 7b 6d |n..% |\begin{m|
|00001d00| 61 63 72 6f 63 6f 64 65 | 7d 0a 5c 6e 65 77 63 6f |acrocode|}.\newco|
|00001d10| 6d 6d 61 6e 64 7b 5c 49 | 66 6f 70 65 6e 7d 5b 33 |mmand{\I|fopen}[3|
|00001d20| 5d 7b 25 0a 20 20 20 5c | 63 73 6e 61 6d 65 20 69 |]{%. \|csname i|
|00001d30| 66 23 31 6f 70 65 6e 5c | 65 6e 64 63 73 6e 61 6d |f#1open\|endcsnam|
|00001d40| 65 23 32 5c 65 6c 73 65 | 23 33 5c 66 69 7d 25 0a |e#2\else|#3\fi}%.|
|00001d50| 25 20 20 20 20 5c 65 6e | 64 7b 6d 61 63 72 6f 63 |% \en|d{macroc|
|00001d60| 6f 64 65 7d 0a 25 20 20 | 20 20 5c 65 6e 64 7b 6d |ode}.% | \end{m|
|00001d70| 61 63 72 6f 7d 0a 25 0a | 25 20 20 20 20 5c 62 65 |acro}.%.|% \be|
|00001d80| 67 69 6e 7b 6d 61 63 72 | 6f 7d 7b 5c 49 66 66 69 |gin{macr|o}{\Iffi|
|00001d90| 6c 65 75 6e 64 65 66 69 | 6e 65 64 7d 0a 25 20 20 |leundefi|ned}.% |
|00001da0| 20 20 57 65 20 61 6c 73 | 6f 20 6e 65 65 64 20 74 | We als|o need t|
|00001db0| 6f 20 63 68 65 63 6b 20 | 77 68 65 74 68 65 72 20 |o check |whether |
|00001dc0| 61 20 66 69 6c 65 20 76 | 61 72 69 61 62 6c 65 20 |a file v|ariable |
|00001dd0| 68 61 73 20 61 6c 72 65 | 61 64 79 20 62 65 65 6e |has alre|ady been|
|00001de0| 20 64 65 66 69 6e 65 64 | 0a 25 20 20 20 20 66 6f | defined|.% fo|
|00001df0| 72 20 61 20 67 69 76 65 | 6e 20 66 69 6c 65 6e 61 |r a give|n filena|
|00001e00| 6d 65 2e 0a 25 20 20 20 | 20 5c 62 65 67 69 6e 7b |me..% | \begin{|
|00001e10| 6d 61 63 72 6f 63 6f 64 | 65 7d 0a 5c 6e 65 77 63 |macrocod|e}.\newc|
|00001e20| 6f 6d 6d 61 6e 64 7b 5c | 49 66 66 69 6c 65 75 6e |ommand{\|Iffileun|
|00001e30| 64 65 66 69 6e 65 64 7d | 5b 33 5d 7b 25 0a 20 20 |defined}|[3]{%. |
|00001e40| 20 5c 63 73 6e 61 6d 65 | 20 69 66 78 5c 65 78 70 | \csname| ifx\exp|
|00001e50| 61 6e 64 61 66 74 65 72 | 5c 65 6e 64 63 73 6e 61 |andafter|\endcsna|
|00001e60| 6d 65 5c 63 73 6e 61 6d | 65 20 23 31 40 66 69 6c |me\csnam|e #1@fil|
|00001e70| 65 5c 65 6e 64 63 73 6e | 61 6d 65 5c 72 65 6c 61 |e\endcsn|ame\rela|
|00001e80| 78 23 32 5c 65 6c 73 65 | 23 33 5c 66 69 7d 0a 25 |x#2\else|#3\fi}.%|
|00001e90| 20 20 20 20 5c 65 6e 64 | 7b 6d 61 63 72 6f 63 6f | \end|{macroco|
|00001ea0| 64 65 7d 0a 25 20 20 20 | 20 5c 65 6e 64 7b 6d 61 |de}.% | \end{ma|
|00001eb0| 63 72 6f 7d 0a 25 0a 25 | 0a 25 20 20 20 20 5c 73 |cro}.%.%|.% \s|
|00001ec0| 65 63 74 69 6f 6e 7b 54 | 68 65 20 66 69 6c 65 20 |ection{T|he file |
|00001ed0| 69 6e 74 65 72 66 61 63 | 65 7d 0a 25 0a 25 20 20 |interfac|e}.%.% |
|00001ee0| 20 20 5c 62 65 67 69 6e | 7b 6d 61 63 72 6f 7d 7b | \begin|{macro}{|
|00001ef0| 5c 4f 70 65 6e 73 6f 6c | 75 74 69 6f 6e 66 69 6c |\Opensol|utionfil|
|00001f00| 65 7d 0a 25 20 20 20 20 | 42 65 66 6f 72 65 20 77 |e}.% |Before w|
|00001f10| 65 20 63 61 6e 20 77 72 | 69 74 65 20 73 6f 6c 75 |e can wr|ite solu|
|00001f20| 74 69 6f 6e 73 2c 20 77 | 65 20 6d 75 73 74 20 6f |tions, w|e must o|
|00001f30| 70 65 6e 20 74 68 65 20 | 73 6f 6c 75 74 69 6f 6e |pen the |solution|
|00001f40| 20 66 69 6c 65 28 73 29 | 2e 0a 25 20 20 20 20 54 | file(s)|..% T|
|00001f50| 68 65 20 63 6f 6d 6d 61 | 6e 64 20 74 6f 20 64 6f |he comma|nd to do|
|00001f60| 20 74 68 69 73 20 74 61 | 6b 65 73 20 61 20 73 69 | this ta|kes a si|
|00001f70| 6e 67 6c 65 20 70 61 72 | 61 6d 65 74 65 72 2c 20 |ngle par|ameter, |
|00001f80| 77 68 69 63 68 20 73 68 | 6f 75 6c 64 20 62 65 0a |which sh|ould be.|
|00001f90| 25 20 20 20 20 61 20 66 | 69 6c 65 20 6e 61 6d 65 |% a f|ile name|
|00001fa0| 20 77 69 74 68 6f 75 74 | 20 65 78 74 65 6e 73 69 | without| extensi|
|00001fb0| 6f 6e 2e 20 54 68 75 73 | 20 69 74 20 73 68 6f 75 |on. Thus| it shou|
|00001fc0| 6c 64 20 70 72 6f 62 61 | 62 6c 79 20 62 65 0a 25 |ld proba|bly be.%|
|00001fd0| 20 20 20 20 72 65 73 74 | 72 69 63 74 65 64 20 74 | rest|ricted t|
|00001fe0| 6f 20 61 20 73 74 72 69 | 6e 67 20 6f 66 20 61 74 |o a stri|ng of at|
|00001ff0| 20 6d 6f 73 74 20 38 20 | 6c 65 74 74 65 72 73 20 | most 8 |letters |
|00002000| 66 6f 72 20 70 6f 72 74 | 61 62 69 6c 69 74 79 2e |for port|ability.|
|00002010| 0a 25 20 20 20 20 54 68 | 69 73 20 6f 70 65 72 61 |.% Th|is opera|
|00002020| 74 69 6f 6e 20 77 69 6c | 6c 20 6e 6f 74 20 74 72 |tion wil|l not tr|
|00002030| 75 6e 63 61 74 65 20 61 | 6e 79 20 65 78 69 73 74 |uncate a|ny exist|
|00002040| 69 6e 67 20 6f 70 65 6e | 20 66 69 6c 65 2e 0a 25 |ing open| file..%|
|00002050| 20 20 20 20 5c 62 65 67 | 69 6e 7b 6d 61 63 72 6f | \beg|in{macro|
|00002060| 63 6f 64 65 7d 0a 5c 64 | 65 66 5c 4f 70 65 6e 73 |code}.\d|ef\Opens|
|00002070| 6f 6c 75 74 69 6f 6e 66 | 69 6c 65 23 31 7b 25 0a |olutionf|ile#1{%.|
|00002080| 20 20 20 5c 49 66 66 69 | 6c 65 75 6e 64 65 66 69 | \Iffi|leundefi|
|00002090| 6e 65 64 7b 23 31 7d 7b | 25 0a 20 20 20 20 20 20 |ned{#1}{|%. |
|000020a0| 5c 65 78 70 61 6e 64 61 | 66 74 65 72 5c 6e 65 77 |\expanda|fter\new|
|000020b0| 77 72 69 74 65 5c 63 73 | 6e 61 6d 65 20 23 31 40 |write\cs|name #1@|
|000020c0| 66 69 6c 65 5c 65 6e 64 | 63 73 6e 61 6d 65 0a 20 |file\end|csname. |
|000020d0| 20 20 20 20 20 5c 63 73 | 6e 61 6d 65 20 6e 65 77 | \cs|name new|
|000020e0| 69 66 5c 65 78 70 61 6e | 64 61 66 74 65 72 5c 65 |if\expan|dafter\e|
|000020f0| 6e 64 63 73 6e 61 6d 65 | 5c 63 73 6e 61 6d 65 20 |ndcsname|\csname |
|00002100| 69 66 23 31 6f 70 65 6e | 5c 65 6e 64 63 73 6e 61 |if#1open|\endcsna|
|00002110| 6d 65 0a 20 20 20 20 20 | 20 5c 63 73 6e 61 6d 65 |me. | \csname|
|00002120| 20 23 31 6f 70 65 6e 66 | 61 6c 73 65 5c 65 6e 64 | #1openf|alse\end|
|00002130| 63 73 6e 61 6d 65 0a 20 | 20 20 20 20 20 5c 40 6e |csname. | \@n|
|00002140| 61 6d 65 64 65 66 7b 23 | 31 40 66 69 6c 65 6e 61 |amedef{#|1@filena|
|00002150| 6d 65 7d 7b 23 31 2e 5c | 73 6f 6c 75 74 69 6f 6e |me}{#1.\|solution|
|00002160| 65 78 74 65 6e 73 69 6f | 6e 7d 25 0a 20 20 20 20 |extensio|n}%. |
|00002170| 20 20 5c 40 6e 61 6d 65 | 64 65 66 7b 4f 70 65 6e | \@name|def{Open|
|00002180| 23 31 68 6f 6f 6b 7d 23 | 23 31 7b 7d 25 0a 20 20 |#1hook}#|#1{}%. |
|00002190| 20 20 20 20 5c 40 6e 61 | 6d 65 64 65 66 7b 43 6c | \@na|medef{Cl|
|000021a0| 6f 73 65 23 31 68 6f 6f | 6b 7d 23 23 31 7b 7d 25 |ose#1hoo|k}##1{}%|
|000021b0| 0a 20 20 20 7d 7b 7d 25 | 0a 20 20 20 5c 6c 65 74 |. }{}%|. \let|
|000021c0| 5c 54 6d 70 5c 72 65 6c | 61 78 0a 20 20 20 5c 49 |\Tmp\rel|ax. \I|
|000021d0| 66 6f 70 65 6e 7b 23 31 | 7d 7b 7d 7b 25 0a 20 20 |fopen{#1|}{}{%. |
|000021e0| 20 20 20 20 5c 69 6d 6d | 65 64 69 61 74 65 5c 6f | \imm|ediate\o|
|000021f0| 70 65 6e 6f 75 74 5c 40 | 6e 61 6d 65 75 73 65 7b |penout\@|nameuse{|
|00002200| 23 31 40 66 69 6c 65 7d | 3d 5c 40 6e 61 6d 65 75 |#1@file}|=\@nameu|
|00002210| 73 65 7b 23 31 40 66 69 | 6c 65 6e 61 6d 65 7d 25 |se{#1@fi|lename}%|
|00002220| 0a 20 20 20 20 20 20 5c | 63 73 6e 61 6d 65 20 23 |. \|csname #|
|00002230| 31 6f 70 65 6e 74 72 75 | 65 5c 65 6e 64 63 73 6e |1opentru|e\endcsn|
|00002240| 61 6d 65 0a 20 20 20 20 | 20 20 5c 64 65 66 5c 54 |ame. | \def\T|
|00002250| 6d 70 7b 5c 40 6e 61 6d | 65 75 73 65 7b 4f 70 65 |mp{\@nam|euse{Ope|
|00002260| 6e 23 31 68 6f 6f 6b 7d | 7b 23 31 7d 7d 25 0a 20 |n#1hook}|{#1}}%. |
|00002270| 20 20 7d 25 0a 20 20 20 | 5c 54 6d 70 0a 7d 0a 25 | }%. |\Tmp.}.%|
|00002280| 20 20 20 20 5c 65 6e 64 | 7b 6d 61 63 72 6f 63 6f | \end|{macroco|
|00002290| 64 65 7d 0a 25 20 20 20 | 20 5c 62 65 67 69 6e 7b |de}.% | \begin{|
|000022a0| 6d 61 63 72 6f 7d 7b 5c | 43 6c 6f 73 65 73 6f 6c |macro}{\|Closesol|
|000022b0| 75 74 69 6f 6e 66 69 6c | 65 7d 0a 25 20 20 20 20 |utionfil|e}.% |
|000022c0| 57 65 20 61 6c 73 6f 20 | 68 61 76 65 20 61 20 63 |We also |have a c|
|000022d0| 6f 6d 6d 61 6e 64 20 74 | 6f 20 63 6c 6f 73 65 20 |ommand t|o close |
|000022e0| 61 6e 20 61 6c 72 65 61 | 64 79 20 6f 70 65 6e 20 |an alrea|dy open |
|000022f0| 66 69 6c 65 2e 0a 25 20 | 20 20 20 5c 62 65 67 69 |file..% | \begi|
|00002300| 6e 7b 6d 61 63 72 6f 63 | 6f 64 65 7d 0a 5c 64 65 |n{macroc|ode}.\de|
|00002310| 66 5c 43 6c 6f 73 65 73 | 6f 6c 75 74 69 6f 6e 66 |f\Closes|olutionf|
|00002320| 69 6c 65 23 31 7b 25 0a | 20 20 20 5c 6c 65 74 5c |ile#1{%.| \let\|
|00002330| 54 6d 70 5c 72 65 6c 61 | 78 0a 20 20 20 5c 49 66 |Tmp\rela|x. \If|
|00002340| 66 69 6c 65 75 6e 64 65 | 66 69 6e 65 64 7b 23 31 |fileunde|fined{#1|
|00002350| 7d 7b 7d 7b 25 0a 20 20 | 20 20 20 20 5c 49 66 6f |}{}{%. | \Ifo|
|00002360| 70 65 6e 7b 23 31 7d 7b | 25 0a 20 20 20 20 20 20 |pen{#1}{|%. |
|00002370| 20 20 20 5c 69 6d 6d 65 | 64 69 61 74 65 5c 63 6c | \imme|diate\cl|
|00002380| 6f 73 65 6f 75 74 5c 40 | 6e 61 6d 65 75 73 65 7b |oseout\@|nameuse{|
|00002390| 23 31 40 66 69 6c 65 7d | 25 0a 20 20 20 20 20 20 |#1@file}|%. |
|000023a0| 20 20 20 5c 63 73 6e 61 | 6d 65 20 23 31 6f 70 65 | \csna|me #1ope|
|000023b0| 6e 66 61 6c 73 65 5c 65 | 6e 64 63 73 6e 61 6d 65 |nfalse\e|ndcsname|
|000023c0| 0a 20 20 20 20 20 20 20 | 20 20 5c 64 65 66 5c 54 |. | \def\T|
|000023d0| 6d 70 7b 5c 40 6e 61 6d | 65 75 73 65 7b 43 6c 6f |mp{\@nam|euse{Clo|
|000023e0| 73 65 23 31 68 6f 6f 6b | 7d 7b 23 31 7d 7d 25 0a |se#1hook|}{#1}}%.|
|000023f0| 20 20 20 20 20 20 7d 7b | 7d 25 0a 20 20 20 7d 25 | }{|}%. }%|
|00002400| 0a 20 20 20 5c 54 6d 70 | 0a 7d 0a 25 20 20 20 20 |. \Tmp|.}.% |
|00002410| 5c 65 6e 64 7b 6d 61 63 | 72 6f 63 6f 64 65 7d 0a |\end{mac|rocode}.|
|00002420| 25 0a 25 20 20 20 20 4e | 6f 74 65 20 74 68 61 74 |%.% N|ote that|
|00002430| 20 74 68 65 20 74 77 6f | 20 66 69 6c 65 20 63 6f | the two| file co|
|00002440| 6d 6d 61 6e 64 73 20 65 | 61 63 68 20 70 72 6f 76 |mmands e|ach prov|
|00002450| 69 64 65 20 61 20 68 6f | 6f 6b 20 77 68 69 63 68 |ide a ho|ok which|
|00002460| 20 61 6c 6c 6f 77 73 20 | 74 68 65 6d 20 74 6f 0a | allows |them to.|
|00002470| 25 20 20 20 20 70 65 72 | 66 6f 72 6d 20 65 78 74 |% per|form ext|
|00002480| 72 61 20 74 61 73 6b 73 | 2e 20 46 6f 72 20 69 6e |ra tasks|. For in|
|00002490| 73 74 61 6e 63 65 2c 20 | 74 68 65 20 6f 70 65 6e |stance, |the open|
|000024a0| 69 6e 67 20 6f 70 65 72 | 61 74 69 6f 6e 20 63 6f |ing oper|ation co|
|000024b0| 75 6c 64 20 62 65 20 6d | 61 64 65 20 74 6f 0a 25 |uld be m|ade to.%|
|000024c0| 20 20 20 20 77 72 69 74 | 65 20 65 78 74 72 61 20 | writ|e extra |
|000024d0| 69 6e 66 6f 72 6d 61 74 | 69 6f 6e 20 74 6f 20 74 |informat|ion to t|
|000024e0| 68 65 20 66 69 6c 65 20 | 62 79 20 72 65 64 65 66 |he file |by redef|
|000024f0| 69 6e 69 6e 67 20 74 68 | 65 20 61 70 70 72 6f 70 |ining th|e approp|
|00002500| 72 69 61 74 65 20 68 6f | 6f 6b 2e 0a 25 20 20 20 |riate ho|ok..% |
|00002510| 20 54 68 65 20 63 6c 6f | 73 69 6e 67 20 6f 70 65 | The clo|sing ope|
|00002520| 72 61 74 69 6f 6e 20 63 | 6f 75 6c 64 20 69 66 20 |ration c|ould if |
|00002530| 72 65 71 75 69 72 65 64 | 20 64 6f 20 61 6e 20 69 |required| do an i|
|00002540| 6d 6d 65 64 69 61 74 65 | 20 7c 5c 69 6e 70 75 74 |mmediate| |\input|
|00002550| 7c 20 6f 66 20 74 68 65 | 0a 25 20 20 20 20 73 6f || of the|.% so|
|00002560| 6c 75 74 69 6f 6e 20 66 | 69 6c 65 20 63 6f 6e 74 |lution f|ile cont|
|00002570| 65 6e 74 73 2e 20 46 6f | 72 20 65 78 61 6d 70 6c |ents. Fo|r exampl|
|00002580| 65 2c 0a 25 20 20 20 20 | 5c 62 65 67 69 6e 7b 76 |e,.% |\begin{v|
|00002590| 65 72 62 61 74 69 6d 7d | 0a 25 20 20 20 20 20 20 |erbatim}|.% |
|000025a0| 20 20 5c 72 65 6e 65 77 | 63 6f 6d 6d 61 6e 64 7b | \renew|command{|
|000025b0| 5c 4f 70 65 6e 78 78 78 | 68 6f 6f 6b 7d 5b 32 5d |\Openxxx|hook}[2]|
|000025c0| 7b 25 0a 25 20 20 20 20 | 20 20 20 20 20 20 20 5c |{%.% | \|
|000025d0| 57 72 69 74 65 74 6f 66 | 69 6c 65 7b 23 31 7d 7b |Writetof|ile{#1}{|
|000025e0| 5c 70 72 6f 74 65 63 74 | 5c 73 65 63 74 69 6f 6e |\protect|\section|
|000025f0| 7b 23 32 7d 7d 25 0a 25 | 20 20 20 20 20 20 20 20 |{#2}}%.%| |
|00002600| 7d 25 0a 25 20 20 20 20 | 20 20 20 20 5c 72 65 6e |}%.% | \ren|
|00002610| 65 77 63 6f 6d 6d 61 6e | 64 7b 5c 43 6c 6f 73 65 |ewcomman|d{\Close|
|00002620| 78 78 78 68 6f 6f 6b 7d | 5b 31 5d 7b 25 0a 25 20 |xxxhook}|[1]{%.% |
|00002630| 20 20 20 20 20 20 20 20 | 20 20 5c 52 65 61 64 73 | | \Reads|
|00002640| 6f 6c 75 74 69 6f 6e 66 | 69 6c 65 7b 23 31 7d 25 |olutionf|ile{#1}%|
|00002650| 0a 25 20 20 20 20 20 20 | 20 20 7d 0a 25 20 20 20 |.% | }.% |
|00002660| 20 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0a | \end{ve|rbatim}.|
|00002670| 25 20 20 20 20 61 6e 64 | 20 74 68 65 6e 0a 25 20 |% and| then.% |
|00002680| 20 20 20 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 | \begi|n{verbat|
|00002690| 69 6d 7d 0a 25 20 20 20 | 20 20 20 20 20 5c 4f 70 |im}.% | \Op|
|000026a0| 65 6e 73 6f 6c 75 74 69 | 6f 6e 66 69 6c 65 7b 78 |ensoluti|onfile{x|
|000026b0| 78 78 7d 7b 41 6e 73 77 | 65 72 73 20 74 6f 20 73 |xx}{Answ|ers to s|
|000026c0| 65 6c 65 63 74 65 64 20 | 70 72 6f 62 6c 65 6d 73 |elected |problems|
|000026d0| 7d 0a 25 20 20 20 20 20 | 20 20 20 2e 2e 2e 0a 25 |}.% | ....%|
|000026e0| 20 20 20 20 20 20 20 20 | 5c 43 6c 6f 73 65 73 6f | |\Closeso|
|000026f0| 6c 75 74 69 6f 6e 66 69 | 6c 65 7b 78 78 78 7d 0a |lutionfi|le{xxx}.|
|00002700| 25 20 20 20 20 5c 65 6e | 64 7b 76 65 72 62 61 74 |% \en|d{verbat|
|00002710| 69 6d 7d 0a 25 20 20 20 | 20 54 68 65 20 64 65 66 |im}.% | The def|
|00002720| 61 75 6c 74 20 62 65 68 | 61 76 69 6f 75 72 20 69 |ault beh|aviour i|
|00002730| 73 20 74 6f 20 69 67 6e | 6f 72 65 20 74 68 65 20 |s to ign|ore the |
|00002740| 6f 6e 65 20 70 61 72 61 | 6d 65 74 65 72 2e 20 4e |one para|meter. N|
|00002750| 6f 74 65 20 74 68 61 74 | 20 69 66 20 79 6f 75 0a |ote that| if you.|
|00002760| 25 20 20 20 20 72 65 64 | 65 66 69 6e 65 20 74 68 |% red|efine th|
|00002770| 65 69 72 20 62 65 68 61 | 76 69 6f 75 72 2c 20 79 |eir beha|viour, y|
|00002780| 6f 75 20 6d 75 73 74 20 | 72 65 6d 65 6d 62 65 72 |ou must |remember|
|00002790| 20 74 68 61 74 20 74 68 | 65 20 66 69 72 73 74 20 | that th|e first |
|000027a0| 70 61 72 61 6d 65 74 65 | 72 20 69 73 0a 25 20 20 |paramete|r is.% |
|000027b0| 20 20 61 6c 77 61 79 73 | 20 74 68 65 20 66 69 6c | always| the fil|
|000027c0| 65 6e 61 6d 65 2e 0a 25 | 20 20 20 20 5c 65 6e 64 |ename..%| \end|
|000027d0| 7b 6d 61 63 72 6f 7d 0a | 25 20 20 20 20 5c 65 6e |{macro}.|% \en|
|000027e0| 64 7b 6d 61 63 72 6f 7d | 0a 25 0a 25 20 20 20 20 |d{macro}|.%.% |
|000027f0| 5c 62 65 67 69 6e 7b 6d | 61 63 72 6f 7d 7b 5c 52 |\begin{m|acro}{\R|
|00002800| 65 61 64 73 6f 6c 75 74 | 69 6f 6e 66 69 6c 65 7d |eadsolut|ionfile}|
|00002810| 0a 25 20 20 20 20 54 68 | 65 20 6f 70 65 72 61 74 |.% Th|e operat|
|00002820| 69 6f 6e 20 6f 66 20 72 | 65 61 64 69 6e 67 20 74 |ion of r|eading t|
|00002830| 68 65 20 66 69 6c 65 20 | 6f 66 20 73 6f 6c 75 74 |he file |of solut|
|00002840| 69 6f 6e 73 20 63 61 6e | 20 62 65 20 64 6f 6e 65 |ions can| be done|
|00002850| 20 77 69 74 68 20 74 68 | 65 0a 25 20 20 20 20 66 | with th|e.% f|
|00002860| 6f 6c 6c 6f 77 69 6e 67 | 20 63 6f 6d 6d 61 6e 64 |ollowing| command|
|00002870| 2e 0a 25 20 20 20 20 5c | 62 65 67 69 6e 7b 6d 61 |..% \|begin{ma|
|00002880| 63 72 6f 63 6f 64 65 7d | 0a 5c 64 65 66 5c 52 65 |crocode}|.\def\Re|
|00002890| 61 64 73 6f 6c 75 74 69 | 6f 6e 66 69 6c 65 23 31 |adsoluti|onfile#1|
|000028a0| 7b 25 0a 20 20 20 5c 49 | 66 66 69 6c 65 75 6e 64 |{%. \I|ffileund|
|000028b0| 65 66 69 6e 65 64 7b 23 | 31 7d 7b 7d 7b 25 0a 20 |efined{#|1}{}{%. |
|000028c0| 20 20 20 20 20 5c 49 66 | 6f 70 65 6e 7b 23 31 7d | \If|open{#1}|
|000028d0| 7b 25 0a 20 20 20 20 20 | 20 20 20 20 5c 74 79 70 |{%. | \typ|
|000028e0| 65 6f 75 74 7b 57 41 52 | 4e 49 4e 47 3a 20 61 74 |eout{WAR|NING: at|
|000028f0| 74 65 6d 70 74 20 74 6f | 20 72 65 61 64 20 6f 70 |tempt to| read op|
|00002900| 65 6e 20 66 69 6c 65 20 | 23 31 7d 25 0a 20 20 20 |en file |#1}%. |
|00002910| 20 20 20 7d 7b 25 0a 20 | 20 20 20 20 20 20 20 20 | }{%. | |
|00002920| 5c 49 6e 70 75 74 49 66 | 46 69 6c 65 45 78 69 73 |\InputIf|FileExis|
|00002930| 74 73 7b 23 31 2e 5c 73 | 6f 6c 75 74 69 6f 6e 65 |ts{#1.\s|olutione|
|00002940| 78 74 65 6e 73 69 6f 6e | 7d 7b 7d 25 0a 20 20 20 |xtension|}{}%. |
|00002950| 20 20 20 20 20 20 20 20 | 20 7b 5c 6d 65 73 73 61 | | {\messa|
|00002960| 67 65 7b 46 69 6c 65 20 | 23 31 2e 5c 73 6f 6c 75 |ge{File |#1.\solu|
|00002970| 74 69 6f 6e 65 78 74 65 | 6e 73 69 6f 6e 5c 73 70 |tionexte|nsion\sp|
|00002980| 61 63 65 20 6e 6f 74 20 | 66 6f 75 6e 64 7d 7d 25 |ace not |found}}%|
|00002990| 0a 20 20 20 20 20 20 7d | 25 0a 20 20 20 7d 25 0a |. }|%. }%.|
|000029a0| 7d 0a 25 20 20 20 20 5c | 65 6e 64 7b 6d 61 63 72 |}.% \|end{macr|
|000029b0| 6f 63 6f 64 65 7d 0a 25 | 20 20 20 20 5c 65 6e 64 |ocode}.%| \end|
|000029c0| 7b 6d 61 63 72 6f 7d 0a | 25 0a 25 0a 25 20 20 20 |{macro}.|%.%.% |
|000029d0| 20 5c 73 65 63 74 69 6f | 6e 7b 54 68 65 20 73 6f | \sectio|n{The so|
|000029e0| 6c 75 74 69 6f 6e 20 69 | 6e 74 65 72 66 61 63 65 |lution i|nterface|
|000029f0| 7d 0a 25 0a 25 20 20 20 | 20 5c 62 65 67 69 6e 7b |}.%.% | \begin{|
|00002a00| 6d 61 63 72 6f 7d 7b 5c | 4e 65 77 61 73 73 6f 63 |macro}{\|Newassoc|
|00002a10| 69 61 74 69 6f 6e 7d 0a | 25 20 20 20 20 53 65 76 |iation}.|% Sev|
|00002a20| 65 72 61 6c 20 73 6f 6c | 75 74 69 6f 6e 20 66 69 |eral sol|ution fi|
|00002a30| 6c 65 73 20 6d 61 79 20 | 68 61 76 65 20 62 65 65 |les may |have bee|
|00002a40| 6e 20 64 65 66 69 6e 65 | 64 2e 20 59 6f 75 20 61 |n define|d. You a|
|00002a50| 72 65 20 6c 69 6d 69 74 | 65 64 20 6f 6e 6c 79 20 |re limit|ed only |
|00002a60| 62 79 20 74 68 65 0a 25 | 20 20 20 20 6e 75 6d 62 |by the.%| numb|
|00002a70| 65 72 20 74 68 61 74 20 | 5c 54 65 58 5c 20 77 69 |er that |\TeX\ wi|
|00002a80| 6c 6c 20 6d 61 6b 65 20 | 61 76 61 69 6c 61 62 6c |ll make |availabl|
|00002a90| 65 20 74 6f 20 79 6f 75 | 2e 20 45 61 63 68 20 73 |e to you|. Each s|
|00002aa0| 6f 6c 75 74 69 6f 6e 20 | 65 6e 76 69 72 6f 6e 6d |olution |environm|
|00002ab0| 65 6e 74 0a 25 20 20 20 | 20 74 68 61 74 20 69 73 |ent.% | that is|
|00002ac0| 20 74 6f 20 77 72 69 74 | 65 20 74 6f 20 6f 6e 65 | to writ|e to one|
|00002ad0| 20 6f 66 20 74 68 65 73 | 65 20 66 69 6c 65 73 20 | of thes|e files |
|00002ae0| 6d 75 73 74 20 6b 6e 6f | 77 20 77 68 69 63 68 20 |must kno|w which |
|00002af0| 66 69 6c 65 20 74 6f 20 | 77 72 69 74 65 20 74 6f |file to |write to|
|00002b00| 2c 0a 25 20 20 20 20 61 | 6e 64 20 61 6c 73 6f 20 |,.% a|nd also |
|00002b10| 77 68 61 74 20 65 78 74 | 72 61 20 69 6e 66 6f 72 |what ext|ra infor|
|00002b20| 6d 61 74 69 6f 6e 20 74 | 6f 20 77 72 69 74 65 20 |mation t|o write |
|00002b30| 74 68 65 72 65 2c 20 61 | 70 61 72 74 20 66 72 6f |there, a|part fro|
|00002b40| 6d 20 69 74 73 20 63 6f | 6e 74 65 6e 74 73 2e 0a |m its co|ntents..|
|00002b50| 25 20 20 20 20 54 68 69 | 73 20 69 73 20 64 6f 6e |% Thi|s is don|
|00002b60| 65 20 62 79 20 73 65 74 | 74 69 6e 67 20 75 70 20 |e by set|ting up |
|00002b70| 61 6e 20 61 73 73 6f 63 | 69 61 74 69 6f 6e 20 62 |an assoc|iation b|
|00002b80| 65 74 77 65 65 6e 20 74 | 68 65 20 73 6f 75 72 63 |etween t|he sourc|
|00002b90| 65 20 65 6e 76 69 72 6f | 6e 6d 65 6e 74 2c 0a 25 |e enviro|nment,.%|
|00002ba0| 20 20 20 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 | the |destinat|
|00002bb0| 69 6f 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |ion envi|ronment |
|00002bc0| 61 6e 64 20 74 68 65 20 | 66 69 6c 65 6e 61 6d 65 |and the |filename|
|00002bd0| 2e 0a 25 20 20 20 20 5c | 62 65 67 69 6e 7b 6d 61 |..% \|begin{ma|
|00002be0| 63 72 6f 63 6f 64 65 7d | 0a 5c 6e 65 77 63 6f 6d |crocode}|.\newcom|
|00002bf0| 6d 61 6e 64 7b 5c 4e 65 | 77 61 73 73 6f 63 69 61 |mand{\Ne|wassocia|
|00002c00| 74 69 6f 6e 7d 5b 33 5d | 7b 25 0a 20 20 20 5c 6e |tion}[3]|{%. \n|
|00002c10| 65 77 73 6f 6c 75 74 69 | 6f 6e 7b 23 32 7d 25 0a |ewsoluti|on{#2}%.|
|00002c20| 20 20 20 5c 6e 65 77 65 | 6e 76 69 72 6f 6e 6d 65 | \newe|nvironme|
|00002c30| 6e 74 7b 23 31 7d 7b 25 | 0a 20 20 20 20 20 20 5c |nt{#1}{%|. \|
|00002c40| 6c 65 74 5c 54 6d 70 5c | 72 65 6c 61 78 0a 20 20 |let\Tmp\|relax. |
|00002c50| 20 20 20 20 5c 49 66 66 | 69 6c 65 75 6e 64 65 66 | \Iff|ileundef|
|00002c60| 69 6e 65 64 7b 23 33 7d | 7b 7d 7b 25 0a 20 20 20 |ined{#3}|{}{%. |
|00002c70| 20 20 20 20 20 20 5c 49 | 66 6f 70 65 6e 7b 23 33 | \I|fopen{#3|
|00002c80| 7d 7b 25 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |}{%. | |
|00002c90| 5c 69 6d 6d 65 64 69 61 | 74 65 5c 77 72 69 74 65 |\immedia|te\write|
|00002ca0| 5c 40 6e 61 6d 65 75 73 | 65 7b 23 33 40 66 69 6c |\@nameus|e{#3@fil|
|00002cb0| 65 7d 25 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |e}%. | |
|00002cc0| 20 20 20 7b 5c 73 74 72 | 69 6e 67 5c 62 65 67 69 | {\str|ing\begi|
|00002cd0| 6e 7b 23 32 7d 5c 40 6e | 61 6d 65 75 73 65 7b 23 |n{#2}\@n|ameuse{#|
|00002ce0| 32 70 61 72 61 6d 73 7d | 7d 25 0a 20 20 20 20 20 |2params}|}%. |
|00002cf0| 20 20 20 20 20 20 20 5c | 64 65 66 5c 54 6d 70 7b | \|def\Tmp{|
|00002d00| 5c 46 69 6c 65 73 61 76 | 65 7b 23 33 7d 7d 25 0a |\Filesav|e{#3}}%.|
|00002d10| 20 20 20 20 20 20 20 20 | 20 7d 7b 7d 25 0a 20 20 | | }{}%. |
|00002d20| 20 20 20 20 7d 25 0a 20 | 20 20 20 20 20 5c 54 6d | }%. | \Tm|
|00002d30| 70 0a 20 20 20 7d 25 0a | 20 20 20 7b 25 0a 20 20 |p. }%.| {%. |
|00002d40| 20 20 20 20 5c 49 66 66 | 69 6c 65 75 6e 64 65 66 | \Iff|ileundef|
|00002d50| 69 6e 65 64 7b 23 33 7d | 7b 7d 7b 25 0a 20 20 20 |ined{#3}|{}{%. |
|00002d60| 20 20 20 20 20 20 5c 49 | 66 6f 70 65 6e 7b 23 33 | \I|fopen{#3|
|00002d70| 7d 7b 25 0a 20 20 20 20 | 20 20 20 20 20 20 20 20 |}{%. | |
|00002d80| 5c 65 6e 64 46 69 6c 65 | 73 61 76 65 25 0a 20 20 |\endFile|save%. |
|00002d90| 20 20 20 20 20 20 20 20 | 20 20 5c 69 6d 6d 65 64 | | \immed|
|00002da0| 69 61 74 65 5c 77 72 69 | 74 65 5c 40 6e 61 6d 65 |iate\wri|te\@name|
|00002db0| 75 73 65 7b 23 33 40 66 | 69 6c 65 7d 7b 5c 73 74 |use{#3@f|ile}{\st|
|00002dc0| 72 69 6e 67 5c 65 6e 64 | 7b 23 32 7d 7d 25 0a 20 |ring\end|{#2}}%. |
|00002dd0| 20 20 20 20 20 20 20 20 | 7d 7b 7d 25 0a 20 20 20 | |}{}%. |
|00002de0| 20 20 20 7d 25 0a 20 20 | 20 7d 25 0a 7d 0a 25 20 | }%. | }%.}.% |
|00002df0| 20 20 20 5c 65 6e 64 7b | 6d 61 63 72 6f 63 6f 64 | \end{|macrocod|
|00002e00| 65 7d 0a 25 20 20 20 20 | 5c 65 6e 64 7b 6d 61 63 |e}.% |\end{mac|
|00002e10| 72 6f 7d 0a 25 0a 25 20 | 20 20 20 5c 62 65 67 69 |ro}.%.% | \begi|
|00002e20| 6e 7b 6d 61 63 72 6f 7d | 7b 5c 6e 65 77 73 6f 6c |n{macro}|{\newsol|
|00002e30| 75 74 69 6f 6e 7d 0a 25 | 20 20 20 20 54 68 65 20 |ution}.%| The |
|00002e40| 64 65 66 61 75 6c 74 20 | 64 65 73 74 69 6e 61 74 |default |destinat|
|00002e50| 69 6f 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |ion envi|ronment |
|00002e60| 69 6e 20 74 68 65 20 73 | 6f 6c 75 74 69 6f 6e 20 |in the s|olution |
|00002e70| 66 69 6c 65 20 69 73 20 | 64 65 66 69 6e 65 64 20 |file is |defined |
|00002e80| 74 6f 0a 25 20 20 20 20 | 74 61 6b 65 20 61 20 73 |to.% |take a s|
|00002e90| 69 6e 67 6c 65 20 70 61 | 72 61 6d 65 74 65 72 2c |ingle pa|rameter,|
|00002ea0| 20 61 20 72 65 66 65 72 | 65 6e 63 65 20 6e 75 6d | a refer|ence num|
|00002eb0| 62 65 72 20 69 6e 68 65 | 72 69 74 65 64 20 66 72 |ber inhe|rited fr|
|00002ec0| 6f 6d 20 74 68 65 20 73 | 6f 75 72 63 65 0a 25 20 |om the s|ource.% |
|00002ed0| 20 20 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 2e 0a | envir|onment..|
|00002ee0| 25 20 20 20 20 5c 62 65 | 67 69 6e 7b 6d 61 63 72 |% \be|gin{macr|
|00002ef0| 6f 7d 7b 5c 43 75 72 72 | 65 6e 74 6c 61 62 65 6c |o}{\Curr|entlabel|
|00002f00| 7d 0a 25 20 20 20 20 5c | 62 65 67 69 6e 7b 6d 61 |}.% \|begin{ma|
|00002f10| 63 72 6f 63 6f 64 65 7d | 0a 5c 6e 65 77 63 6f 6d |crocode}|.\newcom|
|00002f20| 6d 61 6e 64 7b 5c 6e 65 | 77 73 6f 6c 75 74 69 6f |mand{\ne|wsolutio|
|00002f30| 6e 7d 5b 31 5d 7b 25 0a | 20 20 20 5c 40 69 66 75 |n}[1]{%.| \@ifu|
|00002f40| 6e 64 65 66 69 6e 65 64 | 7b 23 31 7d 7b 25 0a 20 |ndefined|{#1}{%. |
|00002f50| 20 20 20 20 20 5c 40 6e | 61 6d 65 64 65 66 7b 23 | \@n|amedef{#|
|00002f60| 31 70 61 72 61 6d 73 7d | 7b 7b 5c 43 75 72 72 65 |1params}|{{\Curre|
|00002f70| 6e 74 6c 61 62 65 6c 7d | 7d 25 0a 20 20 20 20 20 |ntlabel}|}%. |
|00002f80| 20 5c 6e 65 77 65 6e 76 | 69 72 6f 6e 6d 65 6e 74 | \newenv|ironment|
|00002f90| 7b 23 31 7d 5b 31 5d 7b | 25 0a 20 20 20 20 20 20 |{#1}[1]{|%. |
|00002fa0| 20 20 20 5c 74 72 69 76 | 6c 69 73 74 0a 20 20 20 | \triv|list. |
|00002fb0| 20 20 20 20 20 20 5c 69 | 74 65 6d 5b 5c 68 73 6b | \i|tem[\hsk|
|00002fc0| 69 70 5c 69 74 65 6d 73 | 65 70 7b 5c 40 6e 61 6d |ip\items|ep{\@nam|
|00002fd0| 65 75 73 65 7b 23 31 6c | 61 62 65 6c 7d 7b 23 23 |euse{#1l|abel}{##|
|00002fe0| 31 7d 7d 5d 7d 7b 5c 65 | 6e 64 74 72 69 76 6c 69 |1}}]}{\e|ndtrivli|
|00002ff0| 73 74 7d 25 0a 20 20 20 | 20 20 20 5c 40 6e 61 6d |st}%. | \@nam|
|00003000| 65 64 65 66 7b 23 31 6c | 61 62 65 6c 7d 23 23 31 |edef{#1l|abel}##1|
|00003010| 7b 5c 62 66 73 65 72 69 | 65 73 23 23 31 7d 25 0a |{\bfseri|es##1}%.|
|00003020| 20 20 20 7d 7b 5c 74 79 | 70 65 6f 75 74 7b 57 41 | }{\ty|peout{WA|
|00003030| 52 4e 49 4e 47 3a 20 65 | 6e 76 69 72 6f 6e 6d 65 |RNING: e|nvironme|
|00003040| 6e 74 20 23 31 20 61 6c | 72 65 61 64 79 20 69 6e |nt #1 al|ready in|
|00003050| 20 75 73 65 7d 7d 25 0a | 7d 0a 5c 6e 65 77 63 6f | use}}%.|}.\newco|
|00003060| 6d 6d 61 6e 64 7b 5c 43 | 75 72 72 65 6e 74 6c 61 |mmand{\C|urrentla|
|00003070| 62 65 6c 7d 7b 5c 40 63 | 75 72 72 65 6e 74 6c 61 |bel}{\@c|urrentla|
|00003080| 62 65 6c 7d 0a 25 20 20 | 20 20 5c 65 6e 64 7b 6d |bel}.% | \end{m|
|00003090| 61 63 72 6f 63 6f 64 65 | 7d 0a 25 20 20 20 20 54 |acrocode|}.% T|
|000030a0| 68 65 20 66 6f 72 6d 61 | 74 20 6f 66 20 74 68 65 |he forma|t of the|
|000030b0| 20 6c 61 62 65 6c 20 66 | 6f 72 20 73 6f 6c 75 74 | label f|or solut|
|000030c0| 69 6f 6e 20 65 6e 76 69 | 72 6f 6e 6d 65 6e 74 20 |ion envi|ronment |
|000030d0| 7c 78 78 78 7c 20 69 73 | 20 67 6f 76 65 72 6e 65 ||xxx| is| governe|
|000030e0| 64 0a 25 20 20 20 20 62 | 79 20 74 68 65 20 63 6f |d.% b|y the co|
|000030f0| 6d 6d 61 6e 64 20 7c 5c | 78 78 78 6c 61 62 65 6c |mmand |\|xxxlabel|
|00003100| 7c 2c 20 77 68 69 63 68 | 20 74 61 6b 65 73 20 6f ||, which| takes o|
|00003110| 6e 65 20 61 72 67 75 6d | 65 6e 74 20 62 79 20 64 |ne argum|ent by d|
|00003120| 65 66 61 75 6c 74 2e 0a | 25 20 20 20 20 54 68 65 |efault..|% The|
|00003130| 20 61 72 67 75 6d 65 6e | 74 20 69 73 20 70 61 73 | argumen|t is pas|
|00003140| 73 65 64 20 74 6f 20 69 | 74 20 62 79 20 74 68 65 |sed to i|t by the|
|00003150| 20 63 6f 6d 6d 61 6e 64 | 20 7c 5c 78 78 78 70 61 | command| |\xxxpa|
|00003160| 72 61 6d 73 7c 2c 0a 25 | 20 20 20 20 77 68 69 63 |rams|,.%| whic|
|00003170| 68 20 65 78 70 61 6e 64 | 73 20 74 6f 20 7c 7b 5c |h expand|s to |{\|
|00003180| 43 75 72 72 65 6e 74 6c | 61 62 65 6c 7d 7c 2c 20 |Currentl|abel}|, |
|00003190| 61 20 73 79 6e 6f 6e 79 | 6d 20 66 6f 72 20 7c 7b |a synony|m for |{|
|000031a0| 5c 40 63 75 72 72 65 6e | 74 6c 61 62 65 6c 7d 7c |\@curren|tlabel}||
|000031b0| 2c 0a 25 20 20 20 20 61 | 6e 64 20 74 68 69 73 20 |,.% a|nd this |
|000031c0| 61 72 67 75 6d 65 6e 74 | 20 69 73 20 77 72 69 74 |argument| is writ|
|000031d0| 74 65 6e 20 61 75 74 6f | 6d 61 74 69 63 61 6c 6c |ten auto|maticall|
|000031e0| 79 20 62 79 20 74 68 65 | 20 73 6f 75 72 63 65 20 |y by the| source |
|000031f0| 65 6e 76 69 72 6f 6e 6d | 65 6e 74 2e 0a 25 20 20 |environm|ent..% |
|00003200| 20 20 54 68 65 20 6c 61 | 62 65 6c 20 61 70 70 65 | The la|bel appe|
|00003210| 61 72 73 20 69 6e 20 62 | 6f 6c 64 66 61 63 65 20 |ars in b|oldface |
|00003220| 62 79 20 64 65 66 61 75 | 6c 74 2e 0a 25 20 20 20 |by defau|lt..% |
|00003230| 20 57 65 20 63 6f 75 6c | 64 20 65 61 73 69 6c 79 | We coul|d easily|
|00003240| 20 63 68 61 6e 67 65 20 | 74 68 65 20 62 65 68 61 | change |the beha|
|00003250| 76 69 6f 75 72 20 6f 66 | 20 74 68 69 73 20 65 6e |viour of| this en|
|00003260| 76 69 72 6f 6e 6d 65 6e | 74 20 62 79 20 63 68 61 |vironmen|t by cha|
|00003270| 6e 67 69 6e 67 0a 25 20 | 20 20 20 74 68 65 73 65 |nging.% | these|
|00003280| 20 74 77 6f 20 63 6f 6d | 6d 61 6e 64 73 2e 20 46 | two com|mands. F|
|00003290| 6f 72 20 65 78 61 6d 70 | 6c 65 0a 25 20 20 20 20 |or examp|le.% |
|000032a0| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|000032b0| 0a 25 20 20 20 20 20 20 | 20 20 5c 72 65 6e 65 77 |.% | \renew|
|000032c0| 63 6f 6d 6d 61 6e 64 7b | 5c 78 78 78 6c 61 62 65 |command{|\xxxlabe|
|000032d0| 6c 7d 5b 31 5d 7b 5c 65 | 6d 70 68 7b 53 6f 6c 75 |l}[1]{\e|mph{Solu|
|000032e0| 74 69 6f 6e 20 74 6f 20 | 23 31 7d 7d 0a 25 20 20 |tion to |#1}}.% |
|000032f0| 20 20 20 20 20 20 5c 72 | 65 6e 65 77 63 6f 6d 6d | \r|enewcomm|
|00003300| 61 6e 64 7b 5c 78 78 78 | 70 61 72 61 6d 73 7d 7b |and{\xxx|params}{|
|00003310| 7b 5c 43 75 72 72 65 6e | 74 6c 61 62 65 6c 28 70 |{\Curren|tlabel(p|
|00003320| 2e 5c 74 68 65 70 61 67 | 65 29 7d 7d 0a 25 20 20 |.\thepag|e)}}.% |
|00003330| 20 20 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d | \end{v|erbatim}|
|00003340| 0a 25 20 20 20 20 77 6f | 75 6c 64 20 70 72 6f 76 |.% wo|uld prov|
|00003350| 69 64 65 20 61 20 6e 75 | 6d 62 65 72 20 61 6e 64 |ide a nu|mber and|
|00003360| 20 70 61 67 65 20 72 65 | 66 65 72 65 6e 63 65 20 | page re|ference |
|00003370| 69 6e 20 69 74 61 6c 69 | 63 2e 0a 25 0a 25 20 20 |in itali|c..%.% |
|00003380| 20 20 4d 6f 72 65 20 63 | 6f 6d 70 6c 69 63 61 74 | More c|omplicat|
|00003390| 65 64 20 62 65 68 61 76 | 69 6f 75 72 20 63 6f 75 |ed behav|iour cou|
|000033a0| 6c 64 20 62 65 20 70 72 | 6f 64 75 63 65 64 20 62 |ld be pr|oduced b|
|000033b0| 79 20 72 65 64 65 66 69 | 6e 69 6e 67 20 74 68 65 |y redefi|ning the|
|000033c0| 20 7c 78 78 78 7c 0a 25 | 20 20 20 20 65 6e 76 69 | |xxx|.%| envi|
|000033d0| 72 6f 6e 6d 65 6e 74 20 | 69 74 73 65 6c 66 20 74 |ronment |itself t|
|000033e0| 6f 20 74 61 6b 65 20 61 | 20 64 69 66 66 65 72 65 |o take a| differe|
|000033f0| 6e 74 20 6e 75 6d 62 65 | 72 20 6f 66 20 70 61 72 |nt numbe|r of par|
|00003400| 61 6d 65 74 65 72 73 2e | 20 4e 6f 74 65 0a 25 20 |ameters.| Note.% |
|00003410| 20 20 20 68 6f 77 65 76 | 65 72 20 74 68 61 74 20 | howev|er that |
|00003420| 7c 5c 78 78 78 70 61 72 | 61 6d 73 7c 20 6d 75 73 ||\xxxpar|ams| mus|
|00003430| 74 20 62 65 20 72 65 64 | 65 66 69 6e 65 64 20 74 |t be red|efined t|
|00003440| 6f 20 70 72 6f 76 69 64 | 65 20 74 68 6f 73 65 20 |o provid|e those |
|00003450| 70 61 72 61 6d 65 74 65 | 72 73 2e 0a 25 20 20 20 |paramete|rs..% |
|00003460| 20 5c 65 6e 64 7b 6d 61 | 63 72 6f 7d 0a 25 20 20 | \end{ma|cro}.% |
|00003470| 20 20 5c 65 6e 64 7b 6d | 61 63 72 6f 7d 0a 25 0a | \end{m|acro}.%.|
|00003480| 25 20 20 20 20 57 68 69 | 63 68 20 62 72 69 6e 67 |% Whi|ch bring|
|00003490| 73 20 75 73 20 74 6f 20 | 74 68 65 20 65 6e 64 20 |s us to |the end |
|000034a0| 6f 66 20 74 68 65 20 7c | 61 6e 73 77 65 72 73 7c |of the ||answers||
|000034b0| 20 70 61 63 6b 61 67 65 | 2e 0a 25 20 20 20 20 5c | package|..% \|
|000034c0| 62 65 67 69 6e 7b 6d 61 | 63 72 6f 63 6f 64 65 7d |begin{ma|crocode}|
|000034d0| 0a 25 3c 2f 61 6e 73 77 | 65 72 73 3e 0a 25 20 20 |.%</answ|ers>.% |
|000034e0| 20 20 5c 65 6e 64 7b 6d | 61 63 72 6f 63 6f 64 65 | \end{m|acrocode|
|000034f0| 7d 0a 25 0a 25 0a 25 20 | 20 20 20 5c 73 65 63 74 |}.%.%.% | \sect|
|00003500| 69 6f 6e 7b 54 68 65 20 | 64 6f 63 75 6d 65 6e 74 |ion{The |document|
|00003510| 61 74 69 6f 6e 20 64 72 | 69 76 65 72 20 66 69 6c |ation dr|iver fil|
|00003520| 65 7d 0a 25 0a 25 20 20 | 20 20 54 68 69 73 20 69 |e}.%.% | This i|
|00003530| 73 20 74 68 65 20 64 72 | 69 76 65 72 20 66 69 6c |s the dr|iver fil|
|00003540| 65 20 74 68 61 74 20 70 | 72 6f 64 75 63 65 73 20 |e that p|roduces |
|00003550| 74 68 69 73 20 64 6f 63 | 75 6d 65 6e 74 61 74 69 |this doc|umentati|
|00003560| 6f 6e 2e 0a 25 20 20 20 | 20 57 65 20 75 73 65 20 |on..% | We use |
|00003570| 74 68 65 20 64 6f 63 75 | 6d 65 6e 74 20 63 6c 61 |the docu|ment cla|
|00003580| 73 73 20 70 72 6f 76 69 | 64 65 64 20 62 79 20 74 |ss provi|ded by t|
|00003590| 68 65 20 5c 4c 61 54 65 | 58 65 5c 20 64 69 73 74 |he \LaTe|Xe\ dist|
|000035a0| 72 69 62 75 74 69 6f 6e | 0a 25 20 20 20 20 66 6f |ribution|.% fo|
|000035b0| 72 20 70 72 6f 64 75 63 | 69 6e 67 20 74 68 65 20 |r produc|ing the |
|000035c0| 64 6f 63 75 6d 65 6e 74 | 61 74 69 6f 6e 2e 0a 25 |document|ation..%|
|000035d0| 20 20 20 20 5c 62 65 67 | 69 6e 7b 6d 61 63 72 6f | \beg|in{macro|
|000035e0| 63 6f 64 65 7d 0a 25 3c | 2a 64 72 69 76 65 72 3e |code}.%<|*driver>|
|000035f0| 0a 5c 64 6f 63 75 6d 65 | 6e 74 63 6c 61 73 73 7b |.\docume|ntclass{|
|00003600| 6c 74 78 64 6f 63 7d 0a | 5c 52 65 63 6f 72 64 43 |ltxdoc}.|\RecordC|
|00003610| 68 61 6e 67 65 73 20 20 | 20 20 20 20 20 20 20 20 |hanges | |
|00003620| 20 20 20 20 0a 5c 62 65 | 67 69 6e 7b 64 6f 63 75 | .\be|gin{docu|
|00003630| 6d 65 6e 74 7d 0a 20 20 | 5c 44 6f 63 49 6e 70 75 |ment}. |\DocInpu|
|00003640| 74 7b 61 6e 73 77 65 72 | 73 2e 64 74 78 7d 0a 20 |t{answer|s.dtx}. |
|00003650| 20 5c 50 72 69 6e 74 49 | 6e 64 65 78 0a 20 20 5c | \PrintI|ndex. \|
|00003660| 50 72 69 6e 74 43 68 61 | 6e 67 65 73 0a 5c 65 6e |PrintCha|nges.\en|
|00003670| 64 7b 64 6f 63 75 6d 65 | 6e 74 7d 0a 25 3c 2f 64 |d{docume|nt}.%</d|
|00003680| 72 69 76 65 72 3e 0a 25 | 20 20 20 20 5c 65 6e 64 |river>.%| \end|
|00003690| 7b 6d 61 63 72 6f 63 6f | 64 65 7d 0a 25 0a 25 20 |{macroco|de}.%.% |
|000036a0| 5c 46 69 6e 61 6c 65 0a | 25 0a 5c 65 6e 64 69 6e |\Finale.|%.\endin|
|000036b0| 70 75 74 0a 25 0a | |put.%. | |
+--------+-------------------------+-------------------------+--------+--------+